Jump to content
IGNORED

Updated jzIntv: GRAMSHOT, RELOAD, and more


intvnut
 Share

Recommended Posts

I've just posted a 2017-10-31 build for OS/X, Win32, R-Pi and x86-64 Linux.

 

It includes a number of cleanups, fixes and enhancements, including:

  • Honoring 'ecs=1' and 'voice=1' variables in CFG files. You can override with -s0 and -v0 flags on the commandline, respectively
  • Cleaner fall-back when toggling between windowed and fullscreen mode. Previously, if jzIntv couldn't find an appropriate video mode, it would exit. Now, it tries harder to find a workable video mode. If that fails, it will go back to the mode it was using.
  • GRAMSHOT (mapped to Win+G or F8+G on Windows, Cmd+G or F8+G on Mac, or just F8+G on Linux) will write a GIF containing a snapshot of the current contents of GRAM.

  • RELOAD (mapped to Win+Z or F8+Z on Windows, Cmd+Z or F8+Z on Mac, or F8+Z on Linux) will restart jzIntv with all the same flags, reloading whatever game image you had specified. This is useful while developing a game, as it will reload the game from disk as if you restarted jzintv from scratch. Note that it re-parses the entire command line and restarts jzIntv from scratch. If the game fails to reload, jzIntv will exit at that point.
  • Both GRAMSHOT and RELOAD actions can be mapped to other keys with kbdhackfiles.

Please let me know if you run into any issues with this release.

 

Thanks, and enjoy!

 

—J

  • Like 4
Link to comment
Share on other sites

FWIW, I'll see what I can do. No guarantee on time frame, but it doesn't seem too difficult. Mainly I'm juggling personal projects and work, and I try to get as much in on the personal projects when I can.

 

No worries. It's just that I see dumping the contents of GRAM as a debugging activity, more than an emulation activity. In other words, closer to CPU history dump than Screenshot. :)

 

It's still useful, it's just that in a constantly fluid GRAM, it's hard to take a snapshot at the correct moment while running.

 

-dZ.

Link to comment
Share on other sites

The particular use-case for GRAMSHOT actually came from Tarzilla. It arrived in the form of "Can I have a key that dumps the GRAM in this instant, since I want to catch this glitch when I see it." So... that's what I implemented. :-) That is, the original use-case seemed more tied to a transient occurrence. That said, you could probably hit "F4" and drop into the debugger just as easily. *shrug*

 

In any case, it definitely does make sense to offer it from the debugger too. I just haven't implemented it yet.

Link to comment
Share on other sites

It wasn't intended to be a slight, it's a useful feature. I was asking for a further enhancement and a new use case, since I think it would also be useful from the debugger. There's no rush, we've lived this long without it.

 

 

 

That is, the original use-case seemed more tied to a transient occurrence. That said, you could probably hit "F4" and drop into the debugger just as easily. *shrug*

 

 

What does that mean? I don't think I can invoke the GRAMshot function key while the debugger is active since the emulation is halted. No?

Link to comment
Share on other sites

There is a debugger? ;)

 

There wasn't a particular reason for asking for it the way I did, truthfully I don't find myself using the debugger on my own projects much since I've gotten comfortable with IntyBASIC and just considered this feature to be a companion to the Save Video as avi feature

  • Like 1
Link to comment
Share on other sites

 

 

That is, the original use-case seemed more tied to a transient occurrence. That said, you could probably hit "F4" and drop into the debugger just as easily. *shrug*

 

 

What does that mean? I don't think I can invoke the GRAMshot function key while the debugger is active since the emulation is halted. No?

 

All I was saying was that if you are trying to catch a transient behavior "in the act", then hitting "hot key A" to trigger a GRAMSHOT isn't all that much different than hitting "hot key B" to drop into the debugger. That's all I was saying; nothing more.

 

With the current debugger, there's no way to trigger a GRAMSHOT once halted, as you note. I've taken that as a feature request.

 

Flip side: You can hit the current GRAMSHOT a gadzillion times in a row w/out bringing jzIntv to a halt, while hitting the "debugger" key halts jzIntv immediately (provided you've enabled the debugger), so I can see unique uses for both.

 

 

FWIW, I'm working (very slowly) on an SDL2 upgrade to jzintv. SDL2 allows opening multiple windows at once. One thing I've longed for is a "Current GRAM" window, and so maybe someday we'll get it in jzIntv.

Link to comment
Share on other sites

 

All I was saying was that if you are trying to catch a transient behavior "in the act", then hitting "hot key A" to trigger a GRAMSHOT isn't all that much different than hitting "hot key B" to drop into the debugger. That's all I was saying; nothing more.

 

That's what I thought you meant. I guess I must be missing something because, in my opinion, examining GRAM memory with the debugger is not the same as getting a graphical image of it. *shrug*

 

In the past, I've found myself dissecting RAM to see what is the current state of GRAM when debugging animation engines and glitchy behaviour on my graphics subsystems.

 

Having a graphical image would obviously make it easier.

 

dZ.

Link to comment
Share on other sites

  • 2 weeks later...

jzIntv has been updated again, with even more goodies.

 

Big new features:
  • CLASSIFY( ) operator in the assembler will classify a 'thing', making it easier to write polymorphic macros.
  • %% expands to a unique number in each macro expansion, making it easier to create macro-local labels.
  • The debugger command 'gs' generates a GRAM screen shot to "gramXXXX.gif" from the debugger
  • The debugger command 'gt <start> <count>' prints the contents of GRAM in 'ASCII art'. gt with no arguments prints all of GRAM.
  • PAL timings should be fixed.
    • dZ: Could you test programs of yours that have known PAL misbehavior to see if they misbehave as expected in this build? Likewise, test that fixed versions are fixed with this build?
  • Metadata in .ROM files, finally!
    • This carries information such as name, authors, release dates, hardware compatibility, etc.
    • This information was previously limited to BIN+CFG format
    • See jzintv/doc/rom_fmt/id_tag.txt. The spec's been there for awhile, I finally actually implemented it and hooked it all up.
    • rom_merge -s foo.rom strips metadata
    • rom_metadata foo.rom displays metadata
    • jzintv, as1600, bin2rom, rom2bin, rom_merge and other utilities updated to manipulate metadata in .ROM files.
    • CFGVAR generates the same metadata in a BIN+CFG as it does for ROM.
I do hope to post the source code relatively soon. Just since the last release, the diffstat shows ~4600 lines of updates. Since the beginning of the year:
 405 files changed, 72128 insertions(+), 63533 deletions(-)
And that's after excluding generated files.

Yikes... Now, a good portion of that is just maintenance churn (const correctness, cleanups, etc). But still...

 

 

The CLASSIFY operator is a nifty new tool that should help when writing polymorphic macros, among other things. The syntax is: CLASSIFY( thing ). It evaluates to an integer value. The following values are possible:


CLASS.ABS       EQU (-1)
CLASS.SET       EQU (-2)
CLASS.EQU       EQU (-3)
CLASS.STRING    EQU (-4)
CLASS.FEATURE   EQU (-5)
CLASS.RESV      EQU (-6)
CLASS.EMPTY     EQU (-7)
CLASS.UNUSED    EQU (-
CLASS.UNKNOWN   EQU (-9)
CLASS.UNDEF     EQU (-10000)

In practice, UNUSED and UNKNOWN should never occur. See jzintv/doc/utilities/as1600.txt and jzintv/doc/utilities/classify_example.asm for more details.

 

Another big feature in the assembler is the new %% macro expansion. Inside a macro, %% will expand to a unique decimal value in each new macro expansion. This makes it easier to generate macro local labels. See jzintv/doc/utilities/macro.txt for more details.

 

 

The 'gs' command in the debugger takes a GRAMSHOT, similarly to the hot-key that does this during the game.

 

The 'gt <start> <count>' command in the debugger prints out GRAM contents as ASCII art. 'gt' by itself prints the full GRAM. Examples from Utopia:

> gt
    0      0 1      1 2      2 3      3 4      4 5      5 6      6 7      7
0:  ######## ........ ........ ........ ........ ...##... ...##... ....##..
1:  ######## #.#.#.#. #.#..#.# #.#.#.#. ######## ...##... ..####.. ....##..
2:  ######## #######. #.#..#.# .#...#.. ...##... ...##... .##..##. ...#...#
3:  ######## .#####.. #.#..#.# ######## ..####.. ######## ######## .######.
4:  ######## .#####.. ######## ........ ..####.. ######## ######## .##..#..
5:  ######## .#####.. #.####.# #.#.#.#. .######. ...##... #..##### ###.#...
6:  ######## .#####.. ######## .#...#.. .######. ...##... #..##.## ..#.....
7:  ######## .#####.. ###..### ######## ######## ...##... #####.## ..#.....

    8      8 9      9 10     A 11     B 12     C 13     D 14     E 15     F
0:  ........ ........ ........ .....#.. #.#..... #.#....# #....#.. #......#
1:  ........ .....#.. .....#.. #.#....# ......#. ....#... ..#...#. ........
2:  ....#... #....#.. #.#..#.# .....#.. .#.#.#.# .#...#.. ........ .....#..
3:  ...###.. .#.###.. .#.###.. .#.###.. ........ ...#.... .....##. ....##..
4:  .####### ######## ###.#### ######## ######## ##...### ....##.. ..###...
5:  ..#####. .######. .######. .######. .######. .######. .#####.. .###....
6:  ........ ........ ........ ........ ........ ........ ........ ........
7:  ........ ........ ........ ........ ........ ........ ........ ........

    16    10 17    11 18    12 19    13 20    14 21    15 22    16 23    17
0:  ........ ........ ........ ........ .....### #.##.... .####... ########
1:  ........ ........ ........ ........ ....#### #####... ..####.. .#######
2:  ........ ........ ........ ..###... ..###### ####..#. ..####.. ..######
3:  .....#.. ........ ........ .#####.. ...##### #######. ...###.. ..######
4:  ....##.. ....#... ........ ...##### ..###### ######.. ....#... ...#####
5:  ..###... ...##... ...#.... ..####.# ...##### #####... ....#... ..######
6:  ........ ........ ........ .#####.# ..###### ######.. ....##.. ########
7:  ........ ........ ........ ######.. .####### #######. ........ .#######

    24    18 25    19 26    1A 27    1B 28    1C 29    1D 30    1E 31    1F
0:  ######## ....#### #....... .#..##.# .####..# ######## ######## ########
1:  ######## ...##### ###..... ##.##### ######## #.###### ######## #######.
2:  ######.# ...##### ####.... ######## ######## #.###### ######## #####...
3:  ######.. .####### ######.. ######## ######## ..###### ######## ######..
4:  #######. ######## ######## ######## ######## .####### ######## ######..
5:  ######## ..###### ##.####. ######## ######## ######## ##..#### ######..
6:  ######## .####### #...##.. ##...### ######## ######.# ##...### #.###...
7:  #######. ####.##. ........ ...##### .####### .#..##.. #.....## ........

    32    20 33    21 34    22 35    23 36    24 37    25 38    26 39    27
0:  #....#.. ........ ........ ........ ........ ........ ........ ........
1:  ##..#### ........ ........ ........ ........ ........ ........ ........
2:  ######## ........ ........ ........ ........ ........ ........ ........
3:  ######## ........ ........ ........ ........ ........ ........ ........
4:  ######## ........ ........ ........ ........ ........ ........ ........
5:  ######## ........ ........ ........ ........ ........ ........ ........
6:  ######## ........ ........ ........ ........ ........ ........ ........
7:  ######## ........ ........ ........ ........ ........ ........ ........

    40    28 41    29 42    2A 43    2B 44    2C 45    2D 46    2E 47    2F
0:  ........ ........ ........ ........ ........ ........ ........ ........
1:  ........ ........ ........ ........ ........ ........ ........ ........
2:  ........ ........ ........ ........ ........ ........ ........ ........
3:  ........ ........ ........ ........ ........ ........ ........ ........
4:  ........ ........ ........ ........ ........ ........ ........ ........
5:  ........ ........ ........ ........ ........ ........ ........ ........
6:  ........ ........ ........ ........ ........ ........ ........ ........
7:  ........ ........ ........ ........ ........ ........ ........ ........

    48    30 49    31 50    32 51    33 52    34 53    35 54    36 55    37
0:  ..#.#... ........ ...#.... ........ ........ ........ ..##.... ........
1:  ...#..#. ........ ...#.#.. ........ ........ ........ ...#.... ........
2:  .##.#.#. ........ .#....## ........ ........ ........ .#.#.##. ........
3:  #....#.# ........ ..#.#... ........ ........ ........ .#.#.#.# ........
4:  ..#.#..# ........ #..#.#.# ........ ........ ........ .#.#.##. ........
5:  #..#..#. ........ #.#.#.#. ........ ........ ........ .#.#.#.. ........
6:  ..#..#.. ........ .#.#..#. ........ ........ ........ ######## ........
7:  ...#.... ........ ....#... ........ ........ ........ .######. ........

    56    38 57    39 58    3A 59    3B 60    3C 61    3D 62    3E 63    3F
0:  ######## ........ ######## ........ ........ ........ ....#... ....#.#.
1:  #......# ........ #......# ........ ........ ........ .######. ........
2:  #......# ........ #......# ........ ........ ........ ######## ..#..#..
3:  #......# ........ #......# ........ ........ ........ ######## ........
4:  #......# ........ #......# ........ ........ ........ .######. .....#..
5:  #......# ........ #......# ........ ........ ........ ...#.... .#......
6:  #......# ........ #......# ........ ........ ........ .#...#.# ......#.
7:  ######## ........ ######## ........ ........ ........ ........ #..#....
> gt 3
    3      3
0:  ........
1:  #.#.#.#.
2:  .#...#..
3:  ########
4:  ........
5:  #.#.#.#.
6:  .#...#..
7:  ########
> gt 3 5
    3      3 4      4 5      5 6      6 7      7
0:  ........ ........ ...##... ...##... ....##..
1:  #.#.#.#. ######## ...##... ..####.. ....##..
2:  .#...#.. ...##... ...##... .##..##. ...#...#
3:  ######## ..####.. ######## ######## .######.
4:  ........ ..####.. ######## ######## .##..#..
5:  #.#.#.#. .######. ...##... #..##### ###.#...
6:  .#...#.. .######. ...##... #..##.## ..#.....
7:  ######## ######## ...##... #####.## ..#.....
>

  • Like 4
Link to comment
Share on other sites

I've uploaded another update, as well as source code.

 

In this update:

  • Fix a minor memory leak that affects RELOAD mode. (About 1.4K per RELOAD.)
  • Fix a use-after-free bug in bin2luigi. (Only really affects LUI.)
  • Fix some technically undefined arithmetic edge cases.
  • Try to uniformly generate .CFG files in DOS text format (CR+LF) across all tools.
  • Added CFGVAR-based metadata to the SDK-1600 examples, and mark public domain example code as Creative Commons CC0 v1.0.
  • Add an assemble-time warning when .ROM readable section overlaps JLP area.
  • Improve the warning jzIntv issues when it loads a .ROM that asks for JLP, but has a readable section that overlaps JLP.
  • Cleaned up examples/ directory and included with binary releases.
  • Included source code release.

Here's the diffstat:

 examples/4-tris/4-tris.asm             |    8 
 examples/GOOD_ROM_NAMES.txt            |    2 
 examples/balls1/balls1.asm             |    7 
 examples/balls2/balls2.asm             |    8 
 examples/bankdemo/bankdemo.asm         |    7 
 examples/banktest/banktest.asm         |    8 
 examples/bankworld/bankworld.asm       |    8 
 examples/bncpix/bncpix.asm             |    7 
 examples/cc3serial/README.txt          |    2 
 examples/cc3serial/cc3_loopback.asm    |  362 +++++++++++++++++++++++++++++++++
 examples/cc3serial/loopback.asm        |  322 -----------------------------
 examples/counttap/counttap.asm         |   21 +
 examples/csumexec/csumexec.asm         |    4 
 examples/ecs_kbd/README.txt            |   11 -
 examples/ecs_kbd/scan_kbd.asm          |    9 
 examples/ecs_kbd/scan_syn.asm          |    9 
 examples/ecscable/ec_mon2.asm          |    8 
 examples/fileio/a_prnum16.asm          |   10 
 examples/fileio/fileio.asm             |   16 +
 examples/geese/geese.asm               |   19 +
 examples/gram_scroll/gram_scroll.asm   |    8 
 examples/gram_scroll2/gram_scroll2.asm |    7 
 examples/handdemo/handdemo.asm         |    7 
 examples/hello/hello.asm               |    7 
 examples/jlpserial/jlp_loopback.asm    |  278 +++++++++++++++++++++++++
 examples/jlpserial/loopback.asm        |  241 ---------------------
 examples/kbd_test/kbd_test.asm         |   38 +--
 examples/library/colorsq.asm           |   13 -
 examples/library/colorsq_clip.asm      |   13 -
 examples/library/colorsq_sv.asm        |   13 -
 examples/library/dec16dec32.asm        |   13 -
 examples/library/dec16only.asm         |   13 -
 examples/library/dist_fast.asm         |    8 
 examples/library/dividivu.asm          |    8 
 examples/library/fastdivu.asm          |    8 
 examples/library/fillmem.asm           |    8 
 examples/library/gimini.asm            |    8 
 examples/library/hex16.asm             |    8 
 examples/library/hexdisp.asm           |    8 
 examples/library/ic_banksw.asm         |    8 
 examples/library/initmem.asm           |    8 
 examples/library/ivoice.asm            |    8 
 examples/library/memcmp.asm            |    8 
 examples/library/memcpy.asm            |    8 
 examples/library/memset.asm            |    8 
 examples/library/memunpk.asm           |    8 
 examples/library/print.asm             |    8 
 examples/library/prnum16.asm           |   10 
 examples/library/prnum32.asm           |   10 
 examples/library/rand.asm              |    8 
 examples/library/randfast.asm          |    9 
 examples/library/resrom.asm            |    8 
 examples/library/saynum16.asm          |    8 
 examples/library/sqrt.asm              |    8 
 examples/library/wnk.asm               |    8 
 examples/life/life.asm                 |    8 
 examples/lines/lines.asm               |    2 
 examples/macro/initmem.mac             |    9 
 examples/mazedemo/mazedemo.asm         |    7 
 examples/mem_test/mem_test.asm         |    8 
 examples/mob_test/mob_test.asm         |    8 
 examples/sky/sky.asm                   |   16 +
 examples/spacepat/Makefile             |   25 +-
 examples/spacepat/README.txt           |   10 
 examples/spacepat/c/fixsum.c           |   14 -
 examples/spacepat/c/icartrom.c         |   22 ++
 examples/spacepat/c/icartrom.h         |    2 
 examples/spacepat/c/makecity.c         |    2 
 examples/spacepat/c/makerock.c         |    2 
 examples/spacepat/c/maketmnt.c         |    2 
 examples/spacepat/c/pm16.c             |    5 
 examples/spacepat/c/sctc.c             |    6 
 examples/spacepat/c/today.c            |    2 
 examples/spacepat/engine/tracker.asm   |    2 
 examples/spacepat/macro/gfx.mac        |    2 
 examples/spacepat/macro/p16.mac        |    2 
 examples/spacepat/macro/stic.mac       |    2 
 examples/spacepat/macro/util.mac       |    2 
 examples/spacepat/spacepat.asm         |   31 ++
 examples/spacepat/util/prnum16.asm     |    2 
 examples/spacepat/util/prnum32.asm     |    2 
 examples/syn_test/syn_test.asm         |   15 +
 examples/synth/notes.asm               |   14 -
 examples/synth/notes.c                 |   25 +-
 examples/synth/synth.asm               |   15 +
 examples/synth/synth_gfx.asm           |    8 
 examples/tagalong/tagalong.asm         |    8 
 examples/tagalong2/tagalong2.asm       |    7 
 examples/tagalong2/tagalong2b.asm      |    8 
 examples/tagalong2v/tagalong2v.asm     |    8 
 examples/tank/tank.asm                 |   10 
 examples/task/pause.asm                |    8 
 examples/task/scanhand.asm             |    8 
 examples/task/sleep.asm                |    8 
 examples/task/taskq.asm                |    8 
 examples/task/timer.asm                |    8 
 examples/terminal/terminal.asm         |    7 
 examples/world/world.asm               |    8 
 src/asm/collect.c                      |   44 +++-
 src/bincfg/bincfg.c                    |   32 +-
 src/cp1600/cp1600.h                    |    4 
 src/event/event_sdl.c                  |    1 
 src/event/event_sdl2.c                 |    1 
 src/icart/icart.c                      |   12 -
 src/icart/icartbin.c                   |   16 -
 src/icart/icartrom.c                   |   26 +-
 src/icart/icarttag.c                   |   12 +
 src/jzintv.c                           |    4 
 src/locutus/bin_to_loc.cpp             |    2 
 src/locutus/loc_to_bin.cpp             |   30 +-
 src/locutus/locutus.cpp                |    8 
 src/locutus/locutus_types.cpp          |    2 
 src/locutus/locutus_types.hpp          |    1 
 src/locutus/rom_to_loc.cpp             |    2 
 src/metadata/metadata.h                |    2 
 src/misc/types.c                       |    7 
 src/plat/plat_lib.h                    |    5 
 src/util/subMakefile                   |    9 
 119 files changed, 1399 insertions(+), 889 deletions(-)
Edited by intvnut
  • Like 4
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...
 Share

  • Recently Browsing   0 members

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