Jump to content
IGNORED

jzIntv 2015-01-20 build


intvnut

Recommended Posts

Prompted by tarzilla's observation that imvtogif sucks, I made some upgrades to imvtogif, and went ahead and cut a more recent snapshot of jzIntv and SDK-1600.

 

Flags added to imvtogif:

.

.

imvtogif [flags] input.imv output.gif
Flags:
-d## Set minimum delay to ##ms, default 50ms.
-D## Assume GIF decode delay of ##ms, default 3.33ms.
-s Stretch horizontallly 2x.
-f Flat images (no transparency or optimization).

.

.

The -f flag gives what the previous '-' flag did. It disables image optimization. If you set -d0 (or anything 16 or lower), you'll end up with an animated GIF that includes all frames. However, at least in Firefox, the resulting GIF runs like molasses, at least on my Linux box. If you load it in GIMP, however, and play it with its animation playback, it looks just like you're playing jzIntv.

 

The -D flag sets what imvtogif thinks is the penalty for decoding a single GIF frame. I've defaulted that to 3.33ms (previously it was 6.67ms). It doesn't really seem to affect things much.

 

All millisecond times get rounded down to a multiple of 3.33ms in this build.

 

Included with this are the latest builds of jzIntv, AS1600, and the SDK-1600 tools. jzIntv includes myriad updates, including arbitrary display resolutions (see the -z flag), and bugfixes on kbdhackfiles, among other things. AS1600, dis1600, etc. include bug fixes. And so on.

 

Enjoy.

Edited by intvnut
  • Like 4
Link to comment
Share on other sites

Awesome, I love the new -z screen rez options, but "sucks" wasn't quite what I said or inferred ;)

 

 

How does this work? If I played B17 would it just dump them all to wav or do they have to play once in the game?

-Vname --voicefiles=name Saves voice WAV files to name####.wav.

Link to comment
Share on other sites

Awesome, I love the new -z screen rez options, but "sucks" wasn't quite what I said or inferred ;)

 

Ok... "sucks" is my own characterization. I had tweaked imvtogif locally to do all sorts of things to my whim, without ever actually adding flags so that everyone could do that without a recompile. The base imvtogif executable sucked even if you didn't say as much. :) And you're not the first to point it out. :)

 

 

How does this work? If I played B17 would it just dump them all to wav or do they have to play once in the game?

-Vname --voicefiles=name Saves voice WAV files to name####.wav.

 

It only saves the samples that got triggered. I don't have a way to search an executable for samples. But, when a sample gets played, I compare it against previously seen samples (in terms of encoded data) and store out the resulting sample to a new WAV file only if it's unique.

 

I added this to aid the group Astrosmash in collecting voice samples for their music.

 

Note that a single spoken phrase might result in multiple WAV files, and multiple spoken phrases might reuse some of the WAV files.

Edited by intvnut
Link to comment
Share on other sites

!!!!! Xmas came early.

 

Help educate this ignorant moron. What's an imv? I'm guessing some kind of video file that jzintv outputs? So my next question is - could jzintv be made to just output the animated GIF?

 

Yes yes, pipes and all that... fine, I'll stop being lazy :P

 

IMV is jzIntv's Intellivision MoVie format. It was designed to be very cheap to write (so as to not interfere with jzIntv's execution speed). I wrote it back when CPUs were still in the few-hundred-MHz range, I think.

 

The imvtogif converter actually has some expensive optimization steps. I didn't want to try to make that write in real time a dozen years ago. So, it's a separate utility. Also, initially, it was just imvtoppm. It took a little while before I figured out how to encode my own GIFs. (And yes, I did write my own GIF encoder eventually. I don't use a library for that.)

 

The IMV files have some add'l interesting metadata, such as the bounding boxes of all the MOBs. At one point, I had the crazy idea that I was going to write a scripting language that would let me take a collection of IMV files, and direct one or more cameras to take excerpts from those IMV files and build up a larger "movie" from all of them. With the MOB bounding box info, you could direct a camera to follow a particular MOB, for example. None of those pipe dreams happened, obviously.

Edited by intvnut
  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...

Using jzIntv under Win 8.1 x64 3.20GHz with several cores, the sound "clips" badly and the noise channel in particular makes popping sounds and etc. Music tones sound generally OK at the upper ranges, and sound effects that do not integrate noise sound OK also. I am using the following parameters to launch ROMs, can anyone point out what else I can do to make the audio perfect?

jzintv --jlp -v1 -z1 -q -e "C:\Program Files (x86)\jzIntv\bin\exec.bin" -g "C:\Program Files (x86)\jzIntv\bin\grom.bin" myrom.rom
Thanks.

 

Prompted by tarzilla's observation that imvtogif sucks, I made some upgrades to imvtogif, and went ahead and cut a more recent snapshot of jzIntv and SDK-1600.

[snip]

Edited by First Spear
Link to comment
Share on other sites

 

Using jzIntv under Win 8.1 x64 3.20GHz with several cores, the sound "clips" badly and the noise channel in particular makes popping sounds and etc. Music tones sound generally OK at the upper ranges, and sound effects that do not integrate noise sound OK also. I am using the following parameters to launch ROMs, can anyone point out what else I can do to make the audio perfect?

jzintv --jlp -v1 -z1 -q -e "C:\Program Files (x86)\jzIntv\bin\exec.bin" -g "C:\Program Files (x86)\jzIntv\bin\grom.bin" myrom.rom
Thanks.

 

 

Can you run it from a cmd prompt without the -q flag and see what jzIntv report for sound buffering? It would be good to know whether it's dropping sound buffers for some reason.

 

You should see a line like this:

Rate: [100.37% 100.75%]  Drop Gfx:[  0.16%      3] Snd:[  0.07%  1  2.960]

Here's a breakdown of what that line shows:

  • Execution rate as %age of real time. 100% is perfect. First number is long-term average, second number is short-term average. These should hover around 100%.
  • Dropped graphics frames, both as a %age and an absolute count. A small number of dropped frames is typical, especially if you're switching between windows.
  • Dropped audio frames, both as a %age and an absolute count, and also the current audio buffering depth. Again, a small number of dropped audio frames is typical, especially if you're switching between windows.

 

There are some flags to control audio sample rate and buffering, but first let's see if it's dropping audio or if something else is up.

 

Have any other Windows users run into problems with this build? I only have WinXP and Win7 to try running on, and my WinXP box has no speakers.

 

 

EDIT: I'm running it on my aging Dell Win7 laptop, and no audio issues here. Does Win 8.1 have a 'mixer' that allows setting per-app volumes? Maybe that's the culprit. I've never used Windows 8 or 8.1 so I'll have to rely on the rest of you in the peanut gallery for this one.

 

Edited by intvnut
Link to comment
Share on other sites

  • 2 weeks later...

I recently found (and fixed!) a bug in jzIntv's CPU emulation. I will be uploading a new build of jzIntv for all platforms either tonight or tomorrow.

 

Can I ask about the bug details? it would be interesting to know about any further possible optimization with CPU features :)

  • Like 1
Link to comment
Share on other sites

 

Can I ask about the bug details? it would be interesting to know about any further possible optimization with CPU features :)

 

 

Of course you can ask! :)

 

Oh, you want me to tell you the details too... Ok. ;) ;) ;)

 

It was a simple 'facepalm' of a bug. MVO@ R7, R6 (aka. PSHR R7) should push the new value of R7 (the address of the following instruction) rather than the old value. This bug was causing a piece of code like this to loop forever, rather than iterating twice and leaving:

    PSHR R5
    PSHR R7

    ... stuff ...

    PULR PC
  • Like 1
Link to comment
Share on other sites

 

 

 

Of course you can ask! :)

 

Oh, you want me to tell you the details too... Ok. ;) ;) ;)

 

It was a simple 'facepalm' of a bug. MVO@ R7, R6 (aka. PSHR R7) should push the new value of R7 (the address of the following instruction) rather than the old value. This bug was causing a piece of code like this to loop forever, rather than iterating twice and leaving:

    PSHR R5
    PSHR R7

    ... stuff ...

    PULR PC

 

Wow! what an amazing piece of code! :) :thumbsup:

 

Thanks for letting me know!

  • Like 1
Link to comment
Share on other sites

Ok, I've put the latest Windows, Mac and Linux binaries on my website. Find them under "Current Dev Build" along the right edge of the page here: http://spatula-city.org/~im14u2c/intv/

 

"Dev Build" as in, "stable for production"; or "bleeding edge unstable for hard-core developers"?

Link to comment
Share on other sites

 

 

 

Of course you can ask! :)

 

Oh, you want me to tell you the details too... Ok. ;) ;) ;)

 

It was a simple 'facepalm' of a bug. MVO@ R7, R6 (aka. PSHR R7) should push the new value of R7 (the address of the following instruction) rather than the old value. This bug was causing a piece of code like this to loop forever, rather than iterating twice and leaving:

    PSHR R5
    PSHR R7

    ... stuff ...

    PULR PC

 

Interesting. How did it ever cope with the EXEC ISR trap, doesn't it follow that sequence?

Link to comment
Share on other sites

Also,

 

 

"Dev Build" as in, "stable for production"; or "bleeding edge unstable for hard-core developers"?

 

Another question I have is, do you have a change-log or some manifest? If I "diff" the latest SDK/bin distro with my current working set, every single binary is different. Have they all been changed?

 

Also, the memory map has two differences:

Text Compare
Produced: 02/14/2015 06:17:54

Mode:  Differences
Left file: /Users/dz/Downloads/jzintv-1.0-beta4/doc/programming/memory_map.txt
Right file: /Users/dz/Documents/Development/Intellivision/jzintv/doc/programming/memory_map.txt
107     $0700 - $0BFF                   Intellivoice Expansion Bus
    107 $0700 - $0CFF                   Intellivoice Expansion Bus
--------------------------------------------------------------------
--------------------------------------------------------------------
122     $4000 - $47FF                   8-bit Scratch RAM (ECS only)
    122 $4040 - $47FF                   8-bit Scratch RAM (ECS only)
--------------------------------------------------------------------
 

I suppose that the the newer ones ($0700 - $0BFF | $4000 - $47FF) are correct, right?

 

And lastly, there are a few documentation files that have a couple of typos or spurious/trailing white space. These trigger a number of false-positives whenever I compare distributions to upgrade. When I'm in the midst of crunching a release (like during the development of Christmas Carol), it becomes a nuisance to wade through them just to get the single bug-fix that I need without impacting too much on my development environment (I try to avoid just blindly replacing stuff that works, especially when I'm in the middle of a project).

 

So, if I send you updated docs, would you put them in the SDK? I can take a few extra minutes to proof-read all documentation for typos to make it a one-time change. I know it's a very petty and minor thing, but what do you think? :)

 

-dZ.

Edited by DZ-Jay
Link to comment
Share on other sites

 

"Dev Build" as in, "stable for production"; or "bleeding edge unstable for hard-core developers"?

 

Dev Build can mean 'bleeding edge', but I personally only publish stable binaries. I'm just too busy right now to cut a 1.0. This build is more or less identical to the 1-20 build, with the bugs fixed.

 

 

 

Interesting. How did it ever cope with the EXEC ISR trap, doesn't it follow that sequence?

 

No. So far as I know, I haven't run into a program that uses the instruction PSHR R7.

 

 

 

Another question I have is, do you have a change-log or some manifest? If I "diff" the latest SDK/bin distro with my current working set, every single binary is different. Have they all been changed?

 

Are you referring to the executable files? I do upgrade compilers from time to time. Also, some object formats embed the build time in the binary.

 

 

Also, the memory map has two differences:

Text Compare
Produced: 02/14/2015 06:17:54

Mode:  Differences
Left file: /Users/dz/Downloads/jzintv-1.0-beta4/doc/programming/memory_map.txt
Right file: /Users/dz/Documents/Development/Intellivision/jzintv/doc/programming/memory_map.txt
107     $0700 - $0BFF                   Intellivoice Expansion Bus
    107 $0700 - $0CFF                   Intellivoice Expansion Bus
--------------------------------------------------------------------
--------------------------------------------------------------------
122     $4000 - $47FF                   8-bit Scratch RAM (ECS only)
    122 $4040 - $47FF                   8-bit Scratch RAM (ECS only)
--------------------------------------------------------------------
 

I suppose that the the newer ones ($0700 - $0BFF | $4000 - $47FF) are correct, right?

 

Correct. In the case of $4000 - $403F, it's very tricky to use those locations due to the underlying STIC alias.

 

 

And lastly, there are a few documentation files that have a couple of typos or spurious/trailing white space. These trigger a number of false-positives whenever I compare distributions to upgrade. When I'm in the midst of crunching a release (like during the development of Christmas Carol), it becomes a nuisance to wade through them just to get the single bug-fix that I need without impacting too much on my development environment (I try to avoid just blindly replacing stuff that works, especially when I'm in the middle of a project).

 

So, if I send you updated docs, would you put them in the SDK? I can take a few extra minutes to proof-read all documentation for typos to make it a one-time change. I know it's a very petty and minor thing, but what do you think? :)

 

Tell ya what. When I get near a 1.0 release (which will be after I release LTO Flash!), I'll send you a preview and you can send me corrections. Sound good? I don't anticipate another jzIntv (barring a homebrew that hits a new bug) until then.

Edited by intvnut
Link to comment
Share on other sites

Dev Build can mean 'bleeding edge', but I personally only publish stable binaries. I'm just too busy right now to cut a 1.0. This build is more or less identical to the 1-20 build, with the bugs fixed.

OK. I hadn't upgraded for a while. I didn't even have the "1.0" yet.

 

No. So far as I know, I haven't run into a program that uses the instruction PSHR R7.

I'm confused, doesn't the EXEC push R7 into the stack during the interrupt trap, before calling the ISR?

 

Are you referring to the executable files? I do upgrade compilers from time to time. Also, some object formats embed the build time in the binary.

Yes, the executable files. I'll update all of them then.

 

Correct. In the case of $4000 - $403F, it's very tricky to use those locations due to the underlying STIC alias.

Aha! Thanks.

 

Tell ya what. When I get near a 1.0 release (which will be after I release LTO Flash!), I'll send you a preview and you can send me corrections. Sound good? I don't anticipate another jzIntv (barring a homebrew that hits a new bug) until then.

Sure thing.

 

Thanks!

-dZ.

Link to comment
Share on other sites

I'm confused, doesn't the EXEC push R7 into the stack during the interrupt trap, before calling the ISR?

 

 

Never mind, I see that there's some other mysterious mechanism involved:

0040 0000 0118 0040 0107 55F0 02F1 536C -C--I-i-  ANDI #$003F,R0      2225219
0000 0000 0118 0040 0107 55F0 02F1 536E -C-ZI-iq>>  BEQ  HAND.DISP._  2225227 ; \_ Who saved the PC?
0000 0000 0118 0040 0107 55F0 02F2 1004 -C-ZI-iQ  PSHR R0             2225239 ; /
0000 0000 0118 0040 0107 55F0 02F3 1005 -C-ZI---  GSWD R0             2225248
5050 0000 0118 0040 0107 55F0 02F3 1006 -C-ZI---  PSHR R0             2225254
5050 0000 0118 0040 0107 55F0 02F4 1007 -C-ZI---  PSHR R1             2225263
5050 0000 0118 0040 0107 55F0 02F5 1008 -C-ZI---  PSHR R2             2225272
5050 0000 0118 0040 0107 55F0 02F6 1009 -C-ZI---  NOP                 2225281
5050 0000 0118 0040 0107 55F0 02F6 100A -C-ZI-i-  PSHR R3             2225287
5050 0000 0118 0040 0107 55F0 02F7 100B -C-ZI---  PSHR R4             2225296
5050 0000 0118 0040 0107 55F0 02F8 100C -C-ZI---  PSHR R5             2225305
5050 0000 0118 0040 0107 55F0 02F9 100D -C-ZI---  MOVR R7,R5          2225314

I guess that's handled in a different way.

 

Anyway, I'm curious to know how is that pattern used, and how can it be useful?

    PSHR R5
    PSHR R7

    ... stuff ...

    PULR PC

I mean, the fact that nobody has come across it in jzIntv suggests that it is a very rear idiom.

 

-dZ.

Link to comment
Share on other sites

 

Anyway, I'm curious to know how is that pattern used, and how can it be useful?

    PSHR R5
    PSHR R7

    ... stuff ...

    PULR PC

I mean, the fact that nobody has come across it in jzIntv suggests that it is a very rear idiom.

 

-dZ.

 

If your subroutine is at the tail with an operation, and then it RET (that means PULR PC), then you can make it to repeat two times the same code just inserting a PSHR PC just at the start of the code.

 

A very clever trick by Carl Mueller Jr. (author of Ms Pac-Man) to repeat two times a code sequence :)

 

How it works? the RET does PULR PC, so if you put PSHR PC then you're saving the PC value after the PSHR (the thing jzintv had wrong)

 

And when the code comes to the RET it returns first AFTER the PSHR PC, and re-executes the code sequence, and when reaching again the RET it returns to the caller.

Link to comment
Share on other sites

I'm confused, doesn't the EXEC push R7 into the stack during the interrupt trap, before calling the ISR?

It's not possible for the EXEC to push the address of the interrupted code. PSHR R7 pushes the address of the instruction following PSHR R7. :)

 

The CPU itself pushes the current PC to the stack before branching to the EXEC ISR at $1004. The EXEC ISR then pushes the other registers, and finally branches to the user-specified ISR stored in $100-$101.

 

nanochess described how it was being used in this particular piece of code. In particular, I was told the affected code iterated twice, once for "player 1," once for "player 2", IIRC. (Either that, or it was left controller / right controller. I forget.)

 

As far as "rare idiom" goes: I know of only one instance of this pattern in Intellivision code so far. :)

Link to comment
Share on other sites

If your subroutine is at the tail with an operation, and then it RET (that means PULR PC), then you can make it to repeat two times the same code just inserting a PSHR PC just at the start of the code.

 

A very clever trick to repeat two times a code sequence :)

 

How it works? the RET does PULR PC, so if you put PSHR PC then you're saving the PC value after the PSHR (the thing jzintv had wrong)

 

And when the code comes to the RET it returns first AFTER the PSHR PC, and re-executes the code sequence, and when reaching again the RET it returns to the caller.

 

Er... I know how it works and what it does. I was just curious what the original code was using it for, since I've never come across or had a need to do something like that.

 

 

 

It's not possible for the EXEC to push the address of the interrupted code. PSHR R7 pushes the address of the instruction following PSHR R7. :)

 

The CPU itself pushes the current PC to the stack before branching to the EXEC ISR at $1004. The EXEC ISR then pushes the other registers, and finally branches to the user-specified ISR stored in $100-$101.

 

Thought so, thanks.

 

nanochess described how it was being used in this particular piece of code. In particular, I was told the affected code iterated twice, once for "player 1," once for "player 2", IIRC. (Either that, or it was left controller / right controller. I forget.)

 

As far as "rare idiom" goes: I know of only one instance of this pattern in Intellivision code so far. :)

 

Ah, that's clever. I do it differently, but it's because my framework reuses the same code block for player1-only mode and player1-and-player2 mode. I also didn't think of doing that. Cool. :)

 

-dZ.

Link to comment
Share on other sites

 

If your subroutine is at the tail with an operation, and then it RET (that means PULR PC), then you can make it to repeat two times the same code just inserting a PSHR PC just at the start of the code.

 

A very clever trick to repeat two times a code sequence :)

 

How it works? the RET does PULR PC, so if you put PSHR PC then you're saving the PC value after the PSHR (the thing jzintv had wrong)

 

And when the code comes to the RET it returns first AFTER the PSHR PC, and re-executes the code sequence, and when reaching again the RET it returns to the caller.

I don't mind taking credit for this "idiom".

Ms. Pac-Man does it in a couple of places to run the same section of code for both players.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...