Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Meka Debugger Thread

Reply to topic Goto page 1, 2  Next
Author Message
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Meka Debugger Thread
Post Posted: Fri Jan 20, 2012 12:56 pm
Please use this thread to ask question about the debugger, provide feedback, bug reports or new features requests.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Fri Jan 20, 2012 12:59 pm
( continuing from discussion on http://www.smspower.org/forums/viewtopic.php?t=13542 )

Zipper wrote
Bock wrote

You can already do that it is one of the earliest feature the debugger had.
"b label". You can use TAB to automatically completion a symbol name.
Use "sym" or "sym xxx" to find symbols.

Hmm. I see now. It works!
Seems there are problems with Sjasm MODULE's eg "MUSIC.play". But I hardly use those.
Thanks. I could not find it in the help inside MEKA.

There might be a parsing problem with the fact that the symbol include a '.' (dot) character. I will look into that.

What couldn't you find inside the help and could you describe where you have looked? There is a specific help pane for the debugger (corresponding to the DEBUGGER.TXT file) and an HELP command within the label that should give enough examples. If you can help me understand what part you may have overlooked I'm happy to take action to increase accessibility or visibility of the features.
  View user's profile Send private message Visit poster's website
  • Joined: 06 Apr 2011
  • Posts: 250
  • Location: Netherlands
Reply with quote
Post Posted: Fri Jan 20, 2012 1:40 pm
I only looked at the debug pane using "H" and "H B".

With "H B" i'd expected it to also state labels.

E.g.
Parameter:
address : breakpoint address, can be range or symbol (label)


That would have helped.
  View user's profile Send private message
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Fri Jan 20, 2012 2:32 pm
For reference current full help for breakpoints is:

Debugger command - B
--------------------
B/BREAK: Manage breakpoints
Usage:
 B address [..address2]         ; Add CPU breakpoint
 B [access] [bus] address [=xx] ; Add breakpoint
 B LIST                         ; List breakpoints
 B REMOVE id                    ; Remove breakpoint <id>
 B ENABLE id                    ; Enable breakpoint <id>
 B DISABLE id                   ; Disable breakpoint <id>
 B CLEAR                        ; Clear breakpoints
Parameters:
 address : breakpoint address, can be a range
 access  : access to trap, any from r/w/x (rwx)
 bus     : bus/event, one from cpu/io/vram/pal/line (cpu)
 xx      ; byte to compare to, for conditionnal break
 id      : breakpoint identifier
Examples:
 B 0038          ; break when CPU access $0038
 B w io 7f       ; break on IO write to $7F
 B rx e000..ffff ; break on CPU read/exec from $E000+
 B x =0,0,C9     ; break on CPU execution of NOP NOP RET
 B w vram 3f00.. ; break on VRAM write to SAT
 B w pram 0 =03  ; break on PRAM write of color 0 as $03
 B line #13      ; break on display line 13
 
You can add a description to breakpoints, by ending the
command line with a string:
 B 0038 "interrupt"

As a shortcut:
 B nopnop
Is equivalent to:
 B x=0,0 "NOP NOP"

You are right that it doesn't explicitely mention symbols, because they are a more generic feature that apply to anywhere where an address can be passed.

I will add the modification you suggested however because it seems to be such a common case.

Also for reference:
Expression evaluator
--------------------

Mathematical expression can be evaluated by the debugger.
Supported features are:
 - Values:
   - Immediate hexadecimal integer
     (eg: 1234, or $1234 or 0x1234)
   - Immediate binary integer
     (eg: %00101010)
   - Immediate decimal integer
     (eg: #256)
   - Symbols gets replaced by their address.
     (eg: function_label)
   - Z80 registers names gets replaced by their current value.
     (eg: PC, SP, AF, A, BC, B, C, DE, D, E, HL, H, L, IX, IY)
     Pay attention that some registers names are ambiguous with hexadecimal
     constants ('A' is a 10 in hexadecimal). Z80 registers name are always
     given priority over hexadecimal constants.
     Uses the 'Ox' or '$' prefixes to resolve ambiguity.
 - Operators:
   - Integer operators: + - / *
     (eg: 1+2*3 returns 7)
   - Binary operators: & | ^
     (eg: 0xF0 | 0x0F returns 0xFF)
   - Parenthesis: (), forcing priority
     (eg: (1+2)*3 returns 9)

I'll think about how to make it clearer that those features exists, thank you.
  View user's profile Send private message Visit poster's website
  • Joined: 08 Dec 2005
  • Posts: 488
  • Location: Melbourne, Australia
Reply with quote
Post Posted: Sat Jan 21, 2012 11:42 am
I have a related feature request: the ability to set breakpoints on ROM addresses.

For example, there is some data in the Alex Kidd In Miracle World ROM (e.g. at $0f96a - $0fc68) whose purpose is unknown. To find out what the data is for, I'd like to set a breakpoint on the area and play the game until it is triggered. Unfortunately, the best I can do at the moment is set a Z80 breakpoint, using the fact that the game maps banks 2 to 7 of the ROM into slot 2:

b r cpu b96a..bc68

This will be triggered for accesses to $0f96a, but also for $0b96a, $1396a etc. So, each time execution stops, I have to manually check the value at $ffff. It would really help me if it was possible to do:

b r rom f96a..fc68

Thanks
  View user's profile Send private message Visit poster's website
  • Joined: 08 Dec 2005
  • Posts: 488
  • Location: Melbourne, Australia
Reply with quote
Post Posted: Sat Jan 21, 2012 11:55 am
Another way to get the same effect would be to support extended conditions on Z80 breakpoints.

For example, a version of b r cpu b96a..bc68 which only breaks when $ffff (or another chosen Z80 address) contains a certain value.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Sun Jan 22, 2012 2:33 pm
Paul,
I have now added this feature.

Please download from following thread:
http://smspower.org/forums/viewtopic.php?p=69794#69794
Feedback welcome.
  View user's profile Send private message Visit poster's website
  • Joined: 10 Dec 2006
  • Posts: 35
Reply with quote
Post Posted: Mon Jan 30, 2012 5:51 am
I suggested for a Visual Sprite RAM viewer earlier in the Meka 8 Dev Timeline, so I think soon that we should add one...

It is to be used in some game development situations.
  View user's profile Send private message
  • Joined: 06 Apr 2011
  • Posts: 250
  • Location: Netherlands
Reply with quote
Post Posted: Wed Feb 22, 2012 11:27 pm
Is it possible to dump the FM registers in Meka?

I am having problems with the custom voices that do not sound as expected and I am clueless why it sounds different.

Tracing the port writes takes ages.

Example:
Good version
SMS version (initial sfx on start is from the PSG not the FM)
  View user's profile Send private message
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Thu Feb 23, 2012 12:21 am
Zipper, are you able to compile MEKA by yourself?
If so it should be trivial for you to add a few logging lines to print all FM registers, I could guide you through this.

In the meanwhile, are you aware you can use watchpoints to print out all the IO port writes without stopping emulation?
  View user's profile Send private message Visit poster's website
  • Joined: 06 Apr 2011
  • Posts: 250
  • Location: Netherlands
Reply with quote
Post Posted: Fri Feb 24, 2012 10:33 am
Thanks.

I tried the watchpoints (I don't have time to tinker with the Meka code atm). I didn't find any errors in the register values so probably a bug in my code.
  View user's profile Send private message
  • Joined: 06 Apr 2011
  • Posts: 250
  • Location: Netherlands
Reply with quote
Post Posted: Fri Mar 30, 2012 9:03 am
Small update:

The sound issue was a nasty bug (sneaky 1 byte offset error I didn't notice) on my side.

I'll update the MBplay sources for SMS asap.
  View user's profile Send private message
  • Joined: 14 Apr 2013
  • Posts: 623
Reply with quote
Post Posted: Mon Jul 22, 2013 11:51 am
Hi Bock,

I've 3 questions about the symbol feature of Meka:

1. Does Meka ignore the bank information in symbol files?
I've added a symbol as:
0002:b6ee testLabel

and when I set a watchpoint on that label it breaks on a read to b6ee even though the bank is set to 4. Or does it just not work with watchpoints?

2. Could you add labels to RST instructions too?
I'd like to use symbols like:
0000:8 setVRAMaddress

and see the label right next to the RST instruction.

3. Is it possible to show the value of a RAM address pointed to by a label?
For example I'd like to see the value of a variable like:
0000:c025 lives

Is there any way to retrieve it?

Edit: Using the version from this post: http://www.smspower.org/forums/viewtopic.php?t=13019&p=73370#73370

Thanks
Calindro
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Mon Jul 22, 2013 12:11 pm
Thanks for your feedback.

1. As i remember it ignores this because at the time I added symbol parsing MEKA didn't handle "ROM space breakpoints" (only CPU space breakpoints). We now have ROM-space breakpoints so I could fix that.

2. Yes it's possible.

3. For now you can do "p (lives)" but yes, I would have to have some sort of "variables viewer". Maybe you can help suggesting how it would work? A simple version would be to display the value pointed by all symbols located in RAM. There's different syntax to declare them however and some may not provide with an indication of the size. I have to sort this out.

I am adding those request to my MEKA task list but unsure when I can implement them. :/
  View user's profile Send private message Visit poster's website
  • Joined: 14 Apr 2013
  • Posts: 623
Reply with quote
Post Posted: Mon Jul 22, 2013 12:59 pm
Hi Bock,

thanks for your fast reply! :)

Bock wrote
Thanks for your feedback.

You're welcome!

Bock wrote
1. As i remember it ignores this because at the time I added symbol parsing MEKA didn't handle "ROM space breakpoints" (only CPU space breakpoints). We now have ROM-space breakpoints so I could fix that.

Ah I see, that'd be great :)

Bock wrote
3. For now you can do "p (lives)"

I already tried that, but it's giving me same results as "p lives" :(

Bock wrote
but yes, I would have to have some sort of "variables viewer". Maybe you can help suggesting how it would work? A simple version would be to display the value pointed by all symbols located in RAM. There's different syntax to declare them however and some may not provide with an indication of the size. I have to sort this out.

I also thought about that and I think as a start it'd already be great just to always assume a size of 1. In order to stay with the syntax of the sym files I think we could define a grammar on labels. I mean something like "label[size]{format}" so it could be "money[3]{bcd}" For address spaces we could use some kind of end tag like "levelData" and "endlevelData"(is there some convention for naming labels for SMS development?) or some token for 'end' instead. Also it might be cool to take offsets into account. I mean for example HL is set to a base address and a value is added to this base address, I know that the value added is at least 2. So basically the value HL is set to is not the start of the address space but instead HL + 2 would be the start. If I set a label to the address loaded to HL + 2 it will not be shown in the disassembly and if I set it to HL it will point to 2 bytes before the actual data block. So something like "0000:abcd levelData-2" could mean that this label points to levelData-2 and therfor should be displayed at abcf and used when the value abcd is loaded to HL.

Bock wrote
I am adding those request to my MEKA task list but unsure when I can implement them. :/

oh it's ok, take your time :)
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Mon Jul 22, 2013 10:12 pm
I have uploaded a new version, dated of today (July 22).
The labels within a RST instruction are resolved.
I have also added a VARS command that list the value pointed by all symbols located in RAM. If you type "VARS xxx" you can filter the output.

I would like eventually to turn that into its own window with a live search filter but for now as a quick addition it's better than nothing.

On:
Quote
1. Does Meka ignore the bank information in symbol files?
I've added a symbol as:
0002:b6ee testLabel

and when I set a watchpoint on that label it breaks on a read to b6ee even though the bank is set to 4. Or does it just not work with watchpoints?

It is more tricky that I expected because symbols are replaced in the command-line based on their name.

To use breakpoints of this case you would need to use a "break rom xxxx" command and have the ROM address value replaced here, however what happens if you do "break ram xxx" ? "mem xxxx" ? I may need to have the variable replacement depend on the context.
Or, we can come up with a syntax, maybe a prefix, to refer to the ROM address of a symbol instead of its CPU address?
  View user's profile Send private message Visit poster's website
  • Joined: 14 Apr 2013
  • Posts: 623
Reply with quote
Post Posted: Mon Jul 22, 2013 10:36 pm
Wow Bock, thanks a lot! Now these changes will already greatly help me! Really great news! <3 I'm so excited to see how it will help me.

Bock wrote
I have uploaded a new version, dated of today (July 22).
The labels within a RST instruction are resolved.
I have also added a VARS command that list the value pointed by all symbols located in RAM. If you type "VARS xxx" you can filter the output.

Very nice! I just tried it and it works like a charm. <3

Bock wrote
I would like eventually to turn that into its own window with a live search filter but for now as a quick addition it's better than nothing.

That'd also be cool of course. :)

Bock wrote
It is more tricky that I expected because symbols are replaced in the command-line based on their name.

Couldn't it just replace the symbol to "ROM ($address%$4000)+$bankNumber*$4000" if $address is < $c000 or would that break the disassembler?

Bock wrote
To use breakpoints of this case you would need to use a "break rom xxxx" command and have the ROM address value replaced here, however what happens if you do "break ram xxx" ? "mem xxxx" ? I may need to have the variable replacement depend on the context.

If I write "break ram lives" Meka says "Syntax error at "ram".
"mem xxxx" is really nice to investigate memory ranges pointed to by symbols :)

Bock wrote
Or, we can come up with a syntax, maybe a prefix, to refer to the ROM address of a symbol instead of its CPU address?

Sorry but I'm not quite sure what you mean by that. Could you give an example?
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Mon Jul 22, 2013 11:03 pm
Calindro wrote
Couldn't it just replace the symbol to "ROM ($address%$4000)+$bankNumber*$4000" if $address is < $c000 or would that break the disassembler?


No because the CPU address and ROM address are different and depending on the context you may want to use one or another.

Quote
If I write "break ram lives" Meka says "Syntax error at "ram".
"mem xxxx" is really nice to investigate memory ranges pointed to by symbols :)

Sorry it is "break" or "break cpu" that is the regular one.

Quote
Sorry but I'm not quite sure what you mean by that. Could you give an example?

I'm actually implementing it right now. I am using the syntax ':symbol'.
If you write :symbol it gives you the ROM address instread of the CPU address.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Mon Jul 22, 2013 11:16 pm
I committed support for extracting the ROM address of a symbol on the SVN - if you are courageous to try compiling MEKA by yourself :)
  View user's profile Send private message Visit poster's website
  • Joined: 14 Apr 2013
  • Posts: 623
Reply with quote
Post Posted: Mon Jul 22, 2013 11:19 pm
Can't you just do it and silently replace the zip file? ^^
I want to quickly test it before I go to bed.
I'll even immediately give you feedback, if you do it :D
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Mon Jul 22, 2013 11:26 pm
Done :)
  View user's profile Send private message Visit poster's website
  • Joined: 14 Apr 2013
  • Posts: 623
Reply with quote
Post Posted: Tue Jul 23, 2013 12:32 pm
Now it perfectly works! Thanks a lot! :)
  View user's profile Send private message Visit poster's website
  • Joined: 14 Apr 2013
  • Posts: 623
Reply with quote
Post Posted: Tue Jul 23, 2013 2:05 pm
Hi Bock,

I have 1 more request regarding the symbol feature:

Could you make the labels inside the disassembly also take the bank number into account? Until now it's just showing the last defined symbol for that CPU address. So if I have
0003:8000 labelA
0005:8000 labelB

it's showing labelB in the disassembly while bank 3 is mapped to that address. But I'd want to see labelA there.
Could you do that please?
  View user's profile Send private message Visit poster's website
  • Joined: 23 Mar 2013
  • Posts: 611
  • Location: Copenhagen, Denmark
Reply with quote
Won't run?!
Post Posted: Tue Jul 23, 2013 3:22 pm
Last edited by hang-on on Tue Jul 23, 2013 6:48 pm; edited 1 time in total
I have:

Macbook Pro running Win XP in Virtual Box.

I have no problems with mekaw73, but I cannot run these newer versions of MEKA (those with the cheatfinder). It says something like "The program could not run due to a wrong configuration" (translated from Danish), and when I try to run setup, it is the same.

I also have another old pc (with win7), that I actually use when I work with the cheatfinder, because that machine has no problems running newer versions of MEKA, but my mac is faster and less noisy, so it fits better at my end of the couch when me and my wife have 'computertime' in the evening :)

Edit: Win XP - not 95
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Tue Jul 23, 2013 3:25 pm
Windows 95? does that still exists? :)
I don't think it is reasonable to expect Meka code or Allegro to be supported in such an old OS anymore. Have you tried installing a newer version? I mean, we are talking about supporting a 18 years old OS here.
  View user's profile Send private message Visit poster's website
  • Joined: 23 Mar 2013
  • Posts: 611
  • Location: Copenhagen, Denmark
Reply with quote
Post Posted: Tue Jul 23, 2013 6:46 pm
Bock wrote
Windows 95? does that still exists? :)


Oh, I have made a terrible mistake - I have Windows XP on the machine I'm talking about. I don't know what I was thinking when I wrote win95 :) sorry. Maybe it was because I was looking at win95 compatibility options just prior to writing my post...

So it is winXP - but it still wont start. It just kind of terminates...?
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Tue Jul 23, 2013 6:51 pm
Have you used Visual Studio in the past? Do you think you'd be able to install Visual Studio Express 2008 (it is free) on the machine to help me debug the issue?
  View user's profile Send private message Visit poster's website
  • Joined: 23 Mar 2013
  • Posts: 611
  • Location: Copenhagen, Denmark
Reply with quote
Post Posted: Tue Jul 23, 2013 8:02 pm
I'm downloading it right now. Will get back when I have it installed and working. Thank you for your time, Bock.
  View user's profile Send private message Visit poster's website
  • Joined: 14 Apr 2013
  • Posts: 623
Reply with quote
Post Posted: Tue Jul 23, 2013 8:15 pm
Last edited by Calindro on Wed Sep 18, 2013 1:22 pm; edited 1 time in total
I've just booted my old PC running Windows XP and Meka ran just fine on it. Maybe it's some issue related to Virtual Box.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Tue Jul 23, 2013 8:21 pm
Calindro wrote
Hi Bock,

I have 1 more request regarding the symbol feature:

Could you make the labels inside the disassembly also take the bank number into account? Until now it's just showing the last defined symbol for that CPU address. So if I have
0003:8000 labelA
0005:8000 labelB

it's showing labelB in the disassembly while bank 3 is mapped to that address. But I'd want to see labelA there.
Could you do that please?

Done for next build - the code is committed in the SVN repository.
  View user's profile Send private message Visit poster's website
  • Joined: 23 Mar 2013
  • Posts: 611
  • Location: Copenhagen, Denmark
Reply with quote
Post Posted: Tue Jul 23, 2013 9:51 pm
Calindro wrote
I've just booted my old PC running Windows XP and Meka ran just fine on it. Maybe it's some issue related to Virtual Box.


OK, that might be the case. Anyway, now I have Visual C++ up and running here...?
  View user's profile Send private message Visit poster's website
  • Joined: 20 Feb 2008
  • Posts: 118
  • Location: Saintes, France
Reply with quote
Post Posted: Wed Sep 18, 2013 1:19 pm
I use to declare variables in RAM with the directive .EQU in my wla-z80 source files, but doing this doesn't create a label. Therefore the name of my variables don't appear in the .SYM file created by wlalink and I can't see them in MEKA !

Could anyone tell me how I should declare my variables with wla-z80 so that their name appear using MEKA's debugger, please ?
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14689
  • Location: London
Reply with quote
Post Posted: Wed Sep 18, 2013 3:30 pm
.equ x $c001
.equ y $c002
.export x, y

Alternatively:
.enum $c001 export
x db
y db
.ende

...or ramsections.
  View user's profile Send private message Visit poster's website
  • Joined: 20 Feb 2008
  • Posts: 118
  • Location: Saintes, France
Reply with quote
Post Posted: Wed Sep 18, 2013 7:33 pm
Ok, I will use the first method.

Thanks a lot, Maxim :D
  View user's profile Send private message
  • Joined: 23 Mar 2013
  • Posts: 611
  • Location: Copenhagen, Denmark
Reply with quote
Post Posted: Sun Sep 29, 2013 8:40 pm
When I terminate meka (built from svn) with F10, sometimes (1 in 10 maybe), I get this error message (see image).
heap_corruption.png (31.21 KB)
heap corruption
heap_corruption.png

  View user's profile Send private message Visit poster's website
  • Joined: 23 Mar 2013
  • Posts: 611
  • Location: Copenhagen, Denmark
Reply with quote
Sound issue
Post Posted: Thu Nov 14, 2013 8:22 pm
My Meka is having sound troubles. Sound/music is too fast at times, then goes back to normal speed, then too fast again. It was not always like this, so maybe I've done something wrong. I'm getting this message:
PushSamplesRequestBufs... overflow... (some numbers?)

Aside: My Meka window wont resize like a normal windows window?
  View user's profile Send private message Visit poster's website
  • Joined: 23 Mar 2013
  • Posts: 611
  • Location: Copenhagen, Denmark
Reply with quote
Debug error ?!
Post Posted: Thu Nov 14, 2013 10:26 pm
When I work with breakpoints (usually more than one at a time, and keeping with the breakpoint for quite a while, having lots of breaks), Meka sometimes dies on me and shows me this dialog about a debug error (refer to the screenshot attached). It is hard to say exactly what to do to produce the error, because my sessions gets swiped, so the best way I could think of was to attach a screenshot to give an impression of the stuff I was doing prior to the crash.

  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Sun Dec 01, 2013 10:47 pm
I will investigate those crashes. If you can build in DEBUG mode and run with F5 in Visual Studio you should get a callstack which would help me identify the bug probably very easily.
  View user's profile Send private message Visit poster's website
  • Joined: 23 Mar 2013
  • Posts: 611
  • Location: Copenhagen, Denmark
Reply with quote
Post Posted: Wed Dec 04, 2013 8:26 am
OK - I'll try that out and report back if I manage to reproduce a crash while debugging. Btw. - the issue with Enter is most certainly related to Alt+Tabbing. I keep Meka in a window now, and never alt tab to it, and the problem has almost disappeared.
  View user's profile Send private message Visit poster's website
  • Joined: 23 Mar 2013
  • Posts: 611
  • Location: Copenhagen, Denmark
Reply with quote
Solved: Speed/timing (80 frames pr. sec.)
Post Posted: Fri Dec 20, 2013 8:52 pm
hang-on wrote
My Meka is having sound troubles. Sound/music is too fast at times, then goes back to normal speed, then too fast again. It was not always like this, so maybe I've done something wrong. I'm getting this message:
PushSamplesRequestBufs... overflow... (some numbers?)

Aside: My Meka window wont resize like a normal windows window?


- well, this is what you get for trying to have Meka emulate 80 frames pr. second. I looked in the .cfg file, and I honestly can't say why or how, but it clearly said 80 frames here. Oh my... now I have changed it to 60, and the problems disapperared.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3763
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Fri Jan 03, 2014 12:10 pm
I'm using MEKA since some time and I think it's very well done.
Here are the bugs/missing features IMHO:
- it crashes when I lock the workstation (WinXP)
- I can't paste to the debug window (it would be very useful to just copy and paste labels from my sources, and would be faster than using tab completion)
- single key shortcuts (with F6 and F7 keys for example) for run over (continue to next) and run into (enter) calls so that I can debug with two fingers on the keyboard and two eyes on the screen :)
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Fri Jan 03, 2014 2:57 pm
sverx: I'll look at those things today.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Fri Jan 03, 2014 8:12 pm
svrex: I have updated MEKA to address some of your requests.
http://www.smspower.org/forums/viewtopic.php?p=77358#77358

While adding OS clipboard support I realized that Cut/Copy wouldn't make sense without the ability to select text, so I've added standard Hold-Shift-Plus-Arrow-Keys way of selecting text (no mouse selection yet, sorry).

On the matter of shortcuts - the problem is that those keys are used in non-debugging context, and keys like F10 is used to Quit Meka at the moment. While there is a concept of per-app focus within the interface, it is very easy to make a mistake. In the meanwhile I have added buttons for the most common operations that can be clicked on. While I am myself a keyboard user and I realize it isn't 100% perfect, it makes debugging easier already.

I have also updated to the newer version of Allegro which states has bug fixed relative to having "no display" which may refer to locking your computer (the display is passed on to another user). Can you let me know if this fixes your issue?

  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3763
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Tue Jan 07, 2014 9:20 am
Thanks for the new build! :)
I quickly tested it few minutes ago... unfortunately it still crashes when I lock the workstation :|
Pasting text into the debugger works perfectly, but I'm not sure the buttons behave as I would expect... let me explain.
In my mind "Step" and "Over" should both run a single opcode when it's not a 'CALL' (thus they should do the same) and have different behaviors only when running calls: the 'Step' button should run the call opcode and 'enter' the called code whereas the 'Over' button should run everything until we reach the opcode that follows the call... I hope I expressed myself correctly (my English is terrible I know, but I'm trying to improve it...)
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Tue Jan 07, 2014 11:03 am
STEP OVER actually reach the next instructions, so if you STEP OVER on a JZ,DJNZ etc it gets you past it. Is that what is causing you problem or you don't like?

Would you be able to get MEKA sources from SVN, compile in Debug and see if you can get a callstack from the crash? Thank you.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3763
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Tue Jan 07, 2014 12:12 pm
Bock wrote
STEP OVER actually reach the next instructions, so if you STEP OVER on a JZ,DJNZ etc it gets you past it. Is that what is causing you problem or you don't like?


No, that's not a problem. The problem is that for instance if I press 'Over' on a RET, it doesn't step to the next instruction, it goes on just like I had pressed 'Cont'.
(I guess the problem is that I was used to TASM style...)

Bock wrote
Would you be able to get MEKA sources from SVN, compile in Debug and see if you can get a callstack from the crash? Thank you.


Can you compile in Debug for me and send me a link? I can surely send you the callstack and everything else you'd need :)
  View user's profile Send private message Visit poster's website
  • Joined: 06 Dec 2013
  • Posts: 335
  • Location: Canada
Reply with quote
Gamepad Input From $DC In Debugger
Post Posted: Thu Feb 20, 2014 4:59 pm
Hi, I recently started writing small programs with WLA_DX and I have a question regarding the Meka Debugger. I should start off by saying I have alot of professional experience with assemblers and programming in general, just not the Z80.

I am using mekaw073. I have a very short test program which reads the IO port at $dc for gamepad input. When I single step the code, it always returns $ff from IO port $dc even though I am pressing buttons on my gamepad. But, when I let the program run and then halt it at the gamepad routine, I can see the correct values being read from IO port $dc.

Is there any reason why reads from port $dc don't work when single-stepping through code?
  View user's profile Send private message
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Thu Feb 20, 2014 6:26 pm
The issue here is that when the debugger window is focused, your keyboard input aren't affecting the emulated console inputs. If I have a controller plugged in on your PC it should allow to clear the focus disambiguity.
It is a bit of an issue but I haven't come up with a satisfying solution for not studying the problem much, and considering it is a fairly rare use case. Note that as a workaround you can use the "SET A=XX" command to overwrite the A register after the poll has been processed.

I'll see if I can come up with a better way to handle this.

Btw you ought to be using MEKA 0.8x as the debugging features are vastly improved!

*EDIT* ah, I have just realized that you said you ARE using a gamepad. In which case that's definitively a bug that could be fixed without further design implications.
  View user's profile Send private message Visit poster's website
  • Joined: 06 Dec 2013
  • Posts: 335
  • Location: Canada
Reply with quote
Post Posted: Thu Feb 20, 2014 6:37 pm
Ok, thanks for the quick reply. I know it's not a major issue but I just wanted to make sure I wasn't doing something stupid. I should note that I am using a USB gamepad for input, not the keyboard. I'll try it in Meka 0.8 later tonight.

As an aside, I tend to stay away from beta and unofficial releases. I used to work at Research In Motion (makers of the Blackberry smartphone) where they would give each of us a free blackberry and pay our cell phone bill on the condition that we continuously use the latest beta software. Needless to say it was a horrible experience of constant bugs and crashes.
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14689
  • Location: London
Reply with quote
Post Posted: Thu Feb 20, 2014 7:00 pm
Meka is in perpetual beta these days, it's very stable in general.
  View user's profile Send private message Visit poster's website
Reply to topic Goto page 1, 2  Next



Back to the top of this page

Back to SMS Power!