You are not logged in.
Lost Password?

All Posts (Guy Perfect)




#21
Link Behavior
Posted on: 2019/3/5 7:02
VUE(xpert)
Joined 2012/12/4
418 Posts
CoderLong Time User (7 Years)
I need some help verifying some research.

Attached to this post is a test ROM I put together called Communication Workshop for experimenting with link operations. It exposes the CCR, CCSR and CDTR registers to the user for direct manipulation.

Controls are as follows:
• Left D-pad moves the cursor
• Right D-pad up/down changes the selected value
• A button on "Write" stores CCR or CCSR accordingly
• Select button reloads CCR and CCSR into the display (if this were automatic, the user's settings wouldn't stick)

When modifying the value of CDTR, the new value is automatically stored into the register.

If an interrupt is raised, the handler will set C-Int-Inh and CC-Int-Inh to acknowledge it and return. The "IRQ" field will immediately be updated, but the register fields must be refreshed with Select.
__________

Consulting the... shall I say, "primary literature" on the subject (you know the document I mean)... many things fall apart and it does not correctly describe the behaviors I'm observing in my experiments. I'm using a homemade link cable that DogP put together and sent me, and while I'm near certain it's correct, part of me can't shake the thought that something might be off.

So I come to you, the handful of you out there capable of helping me with the communication stuff... Is the following correct?

1) When initiating a communication with the internal clock selection, it will immediately process without a peer and load 0xFF into CDRR.

2) When initiating a communication with the external clock selection, C-Stat will go high until the connected master unit with the internal clock issues a communication. At this point, both units exchange data.

3) When writing to CCSR, the value of CC-Rd on both units is the bitwise AND of the most recent values written to CC-Wr for both units.

4) After communication data is exchanged via CCR, the value of CC-Smp on both units is the bitwise AND of the most recent values written to CC-Sig on both units, as well as a bitwise AND with CC-Rd.

5) Does the C-Int-Inh or CC-Int-Inh bit corresponding with the source of the interrupt need to be set in order to acknowledge the interrupt? The literature says CC-Int-Inh works for both, but I haven't tested it.

6) Setting C-Start while C-Stat is already set will have no effect.

7) I haven't yet tested the behaviors of CC-Rd or CC-Smp with only one unit or without a pending communication on a remote unit. It's getting late and I'm tired. I'll do it tomorrow!

8) Will changing C-Clk-Sel while C-Stat is set abort the current communication? I'd hate to think that the link component could soft-lock itself on both units by waiting for an external master unit that will never come...

Attach file:


vb communication_workshop.vb Size: 16.00 KB; Hits: 75

png  CommunicationWorkshop.png (1.15 KB)
3060_5c7e0ad55a7f9.png 384X224 px
Top

Topic | Forum


#22
Re: PVB Emulator & Fundraiser
Posted on: 2019/3/4 23:54
VUE(xpert)
Joined 2012/12/4
418 Posts
CoderLong Time User (7 Years)
Show of hands, who expected another "Workshop" test ROM? Ah good, everyone. Glad to see it.

Open in new window

Attached to this post is Bit String Workshop, useful for testing the bit string instructions in new and unusual ways.

The top section is the user-configurable part. Move the cursor around with the left D-pad and use up and down on the right D-pad to change values. When you press the Start button, the selected instruction with the current register settings and RAM contents will be invoked, displaying the result in the bottom section.

In the big list of bits, the bus address 05000000 is the location of what is visible on-screen. Each line is 32 bits--one full word--with the least-significant bit on the left.

When the Timer field is set to some non-zero value when Start is pressed, it is used as the counter value on the timer with a 20 ΅s tick interval. When the timer hits zero, it fires an interrupt that will abort any active bit string instruction, then return early so you can see the state of the registers when the interrupt was raised.

The reason there are six rows of bits for what is ostensibly a fairly simple procedure is because of a tricky buffering behavior the CPU exhibits when processing arithmetic strings. The screenshot shows the output that the hardware gives, and I wasn't able to find any other emulator that produces the correct result. PVB gets to be the first. (-:

The tech scroll document has been updated accordingly.

Attach file:


vb bitstring_workshop.vb Size: 16.00 KB; Hits: 62

png  BitStringWorkshop.png (1.44 KB)
3060_5c7da9a8118fb.png 384X224 px
Top

Topic | Forum


#23
Re: PVB Emulator & Fundraiser
Posted on: 2019/3/3 18:08
VUE(xpert)
Joined 2012/12/4
418 Posts
CoderLong Time User (7 Years)
Quote:

VmprHntrD wrote:
So I'm seeing the jar file, and I just realized this for windows is Java based right?

.jar is a self-contained Java program, though it doesn't necessarily need to be used with Windows. Since Java is available for so many operating systems, the idea is that a .jar should be useful just about anywhere.

Quote:

VmprHntrD wrote:
Historically Java has been a big bullseye for virus makers and other trolls. Has it become more secure to feel safer installing that again to take part in using this program or in the future will it use something other than java?

Any malware will attempt to target as large a user base as possible, so the most popular platforms tend to get targeted. This includes Microsoft Windows, Apple iOS and to an extent Java. However, the vast majority of Java malware has targeted people running Java as a web browser plugin, whereas this emulator project is designed to work as a standalone application.

It's absolutely possible for a .jar itself to be malicious, so if you're not comfortable taking that risk, then you shouldn't. An alternative would be to set up a bare-bones virtual machine running something like Linux where you can load up the Java software in a safe, sandboxed environment.

Quote:

VmprHntrD wrote:
This looks like a fantastic program, wholly not the pain in the ass mess that is mednafen.

I appreciate the sentiment. (-:

Mednafen does work well enough as an emulator, so I try to refrain from unnecessarily bashing it, but nonetheless it is one of my go-to examples of difficult user interface design. One of my major goals for the PVB emulator was to make sure all of its features were easy to use, even without reading a manual, so it means a lot that you took notice of that.
Top

Topic | Forum


#24
Re: PVB Emulator
Posted on: 2019/3/1 6:17
VUE(xpert)
Joined 2012/12/4
418 Posts
CoderLong Time User (7 Years)
Go for it. Don't worry about extra work, I do that to myself all the time. (-:
Top

Topic | Forum


#25
Re: vb padder not working
Posted on: 2019/2/27 23:59
VUE(xpert)
Joined 2012/12/4
418 Posts
CoderLong Time User (7 Years)
I posted a padded ROM in the release thread: link to post
Top

Topic | Forum


#26
Re: [Release] Insmouse No Yakata - Innsmouth Mansion - English Translation Patch
Posted on: 2019/2/27 23:58
VUE(xpert)
Joined 2012/12/4
418 Posts
CoderLong Time User (7 Years)
Attached is the ROM padded to 2MiB for those having difficulty getting it padded.

Attach file:


zip Innsmouth.Mansion.English.2MiB.zip Size: 223.08 KB; Hits: 143
Top

Topic | Forum


#27
Re: PVB Emulator
Posted on: 2019/2/27 23:29
VUE(xpert)
Joined 2012/12/4
418 Posts
CoderLong Time User (7 Years)
No amazing, ground-breaking new developments this time, just a round of fun and profit.

New features:
• The game pad is now properly implemented and the tech scroll updated accordingly
• Added support for .isx debugger ROMs
• Added value breakpoint condition symbol for the actual value being read/written
• Added disassembler comment for when an exception/interrupt is raised
• Added disassembler comment for JMP [lp] instructions

Bug fixes:
• Extended duration of DPBSY and XPBSY, enabling Mario's Tennis to function
• Corrected the operation of XB, enabling Jack Bros. to function
• The disassembler now displays TRAP, XB and XH incorrectly
• Step will now enter an exception handler without also executing its first instruction
• Step Over was previously broken, and was reworked to use a breakpoint
• Read and Write breakpoints now detect if any of the bytes being accessed are in the given ranges, not just the exact byte specified
• The Breakpoints window will no longer erroneously show a star next to Read, Write or Exception breakpoints that don't match the current emulation state

Attach file:


jar pvbemu_20190227.jar Size: 292.62 KB; Hits: 68

png  NowWithISX.png (19.79 KB)
3060_5c770f281f045.png 429X334 px
Top

Topic | Forum


#28
Re: PVB Emulator
Posted on: 2019/2/20 23:15
VUE(xpert)
Joined 2012/12/4
418 Posts
CoderLong Time User (7 Years)
Got a new update attached to this post. It includes a few fixes to floating-point operations and VIP behavior that fix a few games like Bound High!, Galactic Pinball and Vertical Force.

The application was reorganized a bit. The Console window still pops up when you load a ROM, but the other windows are now accessed through a new Windows menu.

When you run the emulation, focus is now correctly given to the Console window, so you no longer have to click on it. A third anaglyph color mode has been added with full intensity red/blue like conventional VB emulators.


Breakpoints

Did you think the timer was kinda small for the last two weeks' worth of work? It was! Truth to tell, I only did the timer when I did because it was small and I spent the last two weeks working on breakpoints.

Open in new window

It might not look like much, but the new Breakpoints window is one of the most significant features of the entire application. This tool allows you to stop emulation whenever something you're interested in happens. This is big news for reverse engineering and debugging efforts.

The flexibility of this emulator's breakpoint system is far and away above anything else I've seen (except for MHS). Let's take a look!

Breakpoints can be configured to trigger on one or more of the following conditions:

• Read - An instruction attempts to read from the bus
• Write - An instruction attempts to write to the bus
• Execute - An instruction is about to execute
• Exception - An exception was raised

Crucially, all breakpoints are captured before their respective events are processed. For example, a write breakpoint will stop the program before the value gets written, letting you see what value is being replaced.

Exceptions include operations errors as well as all interrupts. For the most part, interrupts should be trapped with execute breakpoints on their handler addresses.


Addresses

The address field allows you to specify an arbitrary list of individual addresses and address ranges. All figures are expressed in hexadecimal as follows:

• A value by itself is an individual address.
• Two values separated by a hyphen is a range of addresses, with the start on the left and the end on the right.
• Multiple addresses/ranges can be provided simultaneously by separating them with commas.

For read and write breakpoints, the address specifies the bus address being accessed. For execute and exception breakpoints, the address specifies the address of the instruction to be executed or that raises the exception.

It's totally valid to mix-and-match addresses and breakpoint types.


Conditions

The condition field is the big kahuna that sets this emulator apart from the rest. It's a fully-featured expression evaluator that accepts a set of C-like operators in order to determine dynamically when a breakpoint should trigger. This gives breakpoints access to CPU registers, the contents of system memory and operands for the current instruction.

Earlier today, I was helping someone track down Wario's animation data in Wario Land. We started by looking at object 2 (Wario's eye), which has an address of 0003E010. A write breakpoint on that address stopped the program in the function at FFFC1D0C, which is a small function that copies data from a global variable into OAM. Armed with that knowledge, we figured out where object 2 came from by inspecting the CPU state, which allowed the guy to find the data he was looking for.

In the above screenshot, you see a sample breakpoint that stops on all function calls in Wario Land's crt0. The condition expression is "inst == jal || inst == jmp && reg1 != 31", which you can see is accessing instruction operands in order to stop on only specific instructions. It also supplies an address range.

The supported features in the condition are so expansive, in fact, that I can't go over it all here in this forum post. So instead, an HTML file is attached to this post (and included in the .jar) that covers all the specs. I promise it won't disappoint.

The expression evaluator was also exposed to the Goto prompt in the CPU window (Ctrl+G in the disassembler or hex editor).

Attach file:


jar pvbemu_20190220.jar Size: 280.63 KB; Hits: 69

png  Breakpoints.png (9.96 KB)
3060_5c6dcb43c873f.png 400X300 px
html expressions.html Size: 21.29 KB; Hits: 69
Top

Topic | Forum


#29
Re: PVB Emulator
Posted on: 2019/2/17 23:43
VUE(xpert)
Joined 2012/12/4
418 Posts
CoderLong Time User (7 Years)
Attached to this post is another classic feature-testing program called Timer Workshop:

Open in new window


The left D-pad moves the cursor around, the right D-pad's up and down changes the current selection, and pressing A when "Write" is selected will write a value to TCR using the current Clock, Interrupt, Zero Clear and Enable settings. Changing the digits of Reload will immediately write to THR or TLR as appropriate.

As far as I can tell, I've worked out all of the errors in the previous implementation and the emulator now correctly simulates the timer. However, none of the broken games have magically fixed, so I won't put out an update just for this small change.

If you want a quick laugh, go ahead and load Timer Workshop into the current build and watch it break. The moral of the story is that I need to make these "Workshop" programs before I declare something implemented. (-:

The Sacred Tech Scroll has been updated accordingly.

Attach file:


vb timer_workshop.vb Size: 8.00 KB; Hits: 79

png  TimerWorkshop.png (0.95 KB)
3060_5c69e112cd6b9.png 384X224 px
Top

Topic | Forum


#30
Re: Battlezone - 3D Tank
Posted on: 2019/2/17 21:41
VUE(xpert)
Joined 2012/12/4
418 Posts
CoderLong Time User (7 Years)
Quote:

SpectreVR wrote:
I wish to "Learn to code".

Well, that'll be the first challenge, because you'll need to understand programming concepts before digging into someone else's compiled software. Do you have any programming experience, or will this be your first exposure to it?

Quote:

SpectreVR wrote:
I'm interested in the Mac version specifically because it appears to have superior sound and graphics. Even if the virtual boy is incapable of doing all of it, I'd rather use the best version as my reference.

If it were up to me, I'd take a look at all three of the classic Macintosh games and see what comes out. There was also a short-lived iOS version called Spectre 3D, but it's not on the App Store anymore and it won't even let me install it on my phone from my purchase history...

Once upon a time I had the games up and running in a Mac emulator called Basilisk II with System 7.5.1 on it that I'm pretty sure I just downloaded from the Apple website. Can't remember where I found the games themselves, but I still have them in my archives if I need to dig them out.

The SNES version is sort of a dumbed-down implementation of the game and I don't think it's all that interesting. However, it does have various new sorts of obstacles and stage features that would be worth incorporating into a port of the Mac-style games.
Top

Topic | Forum