Jump to content
IGNORED

jzintv Christmas update


intvnut

Recommended Posts

With libretro, jzintv could be made available as a core for RetroArch.  I don't know whether I've asked before, but what would it take to add support for retroachievements?  With the ROM hacking I've been doing lately, I could certainly put together some achievements right out of the gate.

  • Like 1
Link to comment
Share on other sites

Another quick update:  I've got most things working now.  I refactored the event subsystem and have both SDL1 and SDL2 working.

 

There's at least one missing bit:  I don't currently fill in the display borders (-bXX).  That should be quick to add.

 

I also need to try building on Windows and Linux.  So far, I've only built this on my Mac.

 

Lots of little (and a few big) changes...  Still need to refactor gfx/ to move the common code to a common core.

 

1710295258_ScreenShot2020-05-26at12_38_48AM.thumb.png.11591107a0dbd5f3fd5ad14b0fcb258e.png

Link to comment
Share on other sites

33 minutes ago, intvnut said:

Another quick update:  I've got most things working now.  I refactored the event subsystem and have both SDL1 and SDL2 working.

 

There's at least one missing bit:  I don't currently fill in the display borders (-bXX).  That should be quick to add.

 

I also need to try building on Windows and Linux.  So far, I've only built this on my Mac.

 

Lots of little (and a few big) changes...  Still need to refactor gfx/ to move the common code to a common core.

 

Good. Questions time ?
How the compilation will distinguish between SDL1 and SDL2? There will be two different makeFiles or we'll have to pass the definition by command line (-D) ?
Another question (just curious): for the Android and Nintendo Switch ports, which need both SDL2, I used (very) old sources, and I didn't have these SDL2 events problem,
Did you change that management over years?
While you're there, when I tried to compile on windows (Makefile.w32), the svn_revision.c file was excluded by the build, causing compilation error.

Link to comment
Share on other sites

16 hours ago, jenergy said:

Good. Questions time ?
How the compilation will distinguish between SDL1 and SDL2? There will be two different makeFiles or we'll have to pass the definition by command line (-D) ?

I was planning separate Makefiles, although it's possible I could merge them.

 

16 hours ago, jenergy said:

Another question (just curious): for the Android and Nintendo Switch ports, which need both SDL2, I used (very) old sources, and I didn't have these SDL2 events problem,
Did you change that management over years?

How old are we talking?  This line of code (the one that blows up with SDL2) was there in 2006, when I checked everything into Subversion:

    /* -------------------------------------------------------------------- */
    /*  Allocate the event lookup table (this will be huge!).               */
    /* -------------------------------------------------------------------- */
    event->mask_tbl[0]      = calloc (sizeof(event_mask_t), EVENT_LAST * 4);
    event->max_event        = EVENT_LAST;

And EVENT_LAST was tied to SDLK_LAST, which doesn't exist in SDL2.

 

Is it possible you just set SDLK_LAST to a suitable value, since you didn't need the SDLK event numbers that correspond to scancodes for the Android and Switch ports?  That seems quite likely.

 

16 hours ago, jenergy said:

While you're there, when I tried to compile on windows (Makefile.w32), the svn_revision.c file was excluded by the build, causing compilation error.

Ah, yeah.  I haven't used that Makefile in a long time.  I've been using the poorly named "Makefile.stdout" for Windows builds, as it preserves stdout/stderr, rather than redirecting them to files.  I should just rename that to Makefile.w32 and delete the other one.  Also, I doubt Makefile.w32x works at all.  I haven't used it in ages.

 

I should also delete some of the unmaintained ports.  For example, my Nokia N900 is dead, and I imagine almost everyone else's is as well.  I may as well delete N900 support.  I should ping Rick Reynolds to see if he's still interested in the GP2X port.  I also need to find a suitable Amiga fan (or fans) to see if the Amiga and MorphOS ports still work.  I've already deleted the Metrowerks Codewarrior makefile for MacOS Classic.  I don't think that one's worked in 15+ years.

 

Link to comment
Share on other sites

17 hours ago, intvnut said:

 ... I've already deleted the Metrowerks Codewarrior makefile for MacOS Classic.  I don't think that one's worked in 15+ years.

 

So, no reason to break out my Power Mac G3 then... ?

Link to comment
Share on other sites

4 minutes ago, gunoz said:

So, no reason to break out my Power Mac G3 then... ?

You didn't upgrade it to OS/X?  We inherited one of the blue&white G3s when TCU dumped theirs, and I used that for OS/X builds for years.

image.thumb.png.c91c75193e8b29a543af7e3136d207e0.png

 

I think the last MacOS Classic machine we owned was my wife's clamshell iBook.

image.png.b4a7f935a8d70ec51269d82662f61073.png

  • Like 1
Link to comment
Share on other sites

17 minutes ago, gunoz said:

I've got Macs all the way back to the SE. The G3 came to mind because it was the last one I used when I was a Mac SW developer 16+ years ago.

I recently bought a FloppyEmu for my Mac Plus and just put a SCSI2SD in my Mac LC475.  Let me know if we want to test a build on those puppies.  ;)

Edited by Sinjinhawke
corrected typo on SCSI2SD
  • Like 1
Link to comment
Share on other sites

On 5/24/2020 at 5:55 PM, Zendocon said:

With libretro, jzintv could be made available as a core for RetroArch.  I don't know whether I've asked before, but what would it take to add support for retroachievements?  With the ROM hacking I've been doing lately, I could certainly put together some achievements right out of the gate.

Would be outstanding to have an Intellivision/libretro core running in RetroArch.  Hopefully all the graphical tweaks can be used including masks and shaders as well.

 

Will you be able to give Intellivoice support as well as support for the controllers?  Essential for Intellivision.  

Link to comment
Share on other sites

19 minutes ago, IMBerzerk said:

Would be outstanding to have an Intellivision/libretro core running in RetroArch.  Hopefully all the graphical tweaks can be used including masks and shaders as well.

 

Will you be able to give Intellivoice support as well as support for the controllers?  Essential for Intellivision.  

 

I'm not committing to libretro at this time, as I haven't really dug into what it will take.   I will say, Intellivoice support should follow jzIntv wherever it goes, since it's baked into jzIntv.  I don't use WAV samples.  Frank Palazzolo and I reverse engineered the Intellivoice.

Link to comment
Share on other sites

7 minutes ago, intvnut said:

 

I'm not committing to libretro at this time, as I haven't really dug into what it will take.   I will say, Intellivoice support should follow jzIntv wherever it goes, since it's baked into jzIntv.  I don't use WAV samples.  Frank Palazzolo and I reverse engineered the Intellivoice.

Understood.  It's one of those things a lot of Retropie users have been hoping for for ages, mostly because of what it takes to initially get jzintv working and the lack of visual "effects" to get that look a lot of users set they're emulators up for.  

 

It's a great emulator and works flawlessly on Retropie.  I've helped quite a few users on the Retropie forum get it running and passed on my custom color palette as well.  

 

Whatever you decide to do, is your choice to make.  I'm just happy to have what I have and that it works so damn good.

 

Someday it would be great to have scanlines and an old RCA TV mask to give it a true Retro look.  But until then.. no problem.

Link to comment
Share on other sites

Libretro/retroarch has an intellivision emulator called freeintv.  It was buggy when it first came out but the developer was very responsive to complaints.  I haven't tried it in quite a while.  The problem with libretro/retroarch is that it has a controller abstraction that limits controller button mapping.  It's designed for an xbox style controller.  Maybe I'm just not familiar with retroarch, but I don't see how a proper intellivision controller can be used or even how to make full use of a modern controller.  I imagine the emulator developer could bypass it.

 

The main issue with jzintv and retropie is a lack of any default jzintv settings.  Retropie should at least have a decent default resolution, and full screen and intellivoice should be on as well.  A sample keyboard hackfile out of the box would be good too, even if it's empty.  And more default extensions for finding rom files.  Configuring controllers by name is another issue but that can't be addressed by retropie.

  • Like 1
Link to comment
Share on other sites

On 5/27/2020 at 12:26 PM, gunoz said:

I've got Macs all the way back to the SE. The G3 came to mind because it was the last one I used when I was a Mac SW developer 16+ years ago.

Well, if you want to try to help me reheat Tim Lindner's port to MacOS Classic, I suppose I can dig those files back out.  They're in the revision history.

 

On 5/27/2020 at 3:41 PM, mr_me said:

And more default extensions for finding rom files

How many extensions are there out there now?  I search for  bin, int, itvrom, and cc3 currently.

Edited by intvnut
fonts, yo.
Link to comment
Share on other sites

On 1/9/2019 at 1:09 AM, intvdave said:

In appreciation of the ability to SAVE and LOAD in ECS mode, I am sharing ECS Basic files created from basic code at The Intellivision Library.

I managed to get Number Cruncher I working.  The other Number Cruncher and Bomb Run titles I want to tweak a little more.  All the other programs I don't really care about.

 

Number Cruncher I took a fair amount of effort to get working correctly.  Since this is the first time I've worked with the casette save/load features, I wasn't aware that dimensioning an array wouldn't work in the setup program.  I also disabled the cursor's animation, because it would go glitchy and even crash the ECS due to maxing out the program space.

 

There were a few mistakes on the version of the program that I posted on my website, right off the bat.  Line 770 started a FOR loop with C as the iterator, and line 800 closed it with NEXT G.  I changed line 800.  Line 520 should also have increased the verical position by 8 instead of decreasing it.  There were also a few lines that had an extra closed parenthesis, but the ECS caught that.

 

Then there was some optimization needed, because I was getting anomalies with the array values.  Why anybody bothered to implement all the variables as floating point types I can only chalk up to sadism.  I finally eliminated the line to check whether the cursor is on a 0.  As it is, some zeroes behave like 0 and some behave like 10.  I guess the "wildcard" nature only makes it more fun.  I also don't bother to initialize the position of the cursor between games and only set it once, in the initialization program.

 

Okay, enough talk.

 

There are two files here.  Put them both in the same working directory as jzintv.

 

1. Launch jzintv with Checkers and enable ECS.

2. Select BASIC at the ECS menu.

3. At the BASIC interpreter, type "CLOD NC1A" and press Return.  (That's Number Cruncher 1, program A)

4. "SET" will appear.  Press any direction on the disc.

5. "GO" will appear, replacing "SET".  Press any direction on the disc again.

6. "LOAD" will appear, replacing "GO".  Wait until the cursor reappears.  "NC1A" will also appear.

7. Type "RUN" and press Return.  This runs the initialization program, which sets up the environment and displays the title.

8. Type "CLOD NC1B" and press Return.  (Number Cruncher 1, program B)

9. As before, press the disc twice to change "SET" to "GO" to "LOAD".

10. Wait until the cursor reappears again.  This will take a little longer to load.

11. Type "RUN" and press Return.

 

Now for the instructions.  This is meant to be played with two players.

 

First, type a target number between 20 and 100, using the ECS keyboard, and press Return.

 

Wait until both boards populate, each a 6x6 grid of digits.  The bottom half of the screen will begin to fill with purple cards, representing the target value as a meter.

 

Both players share the left controller (the ECS BASIC interpreter only reads the left controller).  Use the disc to move in any of four directions, or a keypad key to jump between boards in the same position.  You can wrap around the edges of each board as well.  Hold the disc/keypad until the cursor moves, then let go and give the controller to the other player.

 

The meter will fill in your color based on the value of the digit you moved to.  Finish filling the meter to win, or force the other player to overfill the meter and lose.

ecs_tape_NC1A.ecs ecs_tape_NC1B.ecs

Link to comment
Share on other sites

Bomb Run II is as good as ready.  Same procedure as before, only now the cartridge to use is Triple Action, and the tape filenames are BR2A and BR2B (Bomb Run 2 A and B).  You might also want to launch jzintv with the -r flag set to something like 3 (-r3), which speeds it up by the specified factor.

 

How to play:

 

This is a single-button game.  Hold any action key on the left controller to drop a bomb on the terrain below.  Clear the terrain with your bombs as your plane passes overhead, a little lower with each pass.  Reach the ground with all the terrain cleared to advance to the next level.  Try to complete all ten levels without crashing into terrain.

 

Corrections from the website:

 

Lines 70-80 are setting the horizontal and vertical size of all the objects when they should be setting the horizontal and vertical velocity instead.  XS and YS should be XV and YV.

 

I tweaked the value of L at line 250 until the plane sounded very close to what it sounds like in Biplanes.

 

The logic at line 470 to make the debris sprites match the color of the terrain hit just wasn't working, and they were turning green, blending in with the background color.  I just randomized their color instead.

ecs_tape_BR2A.ecs ecs_tape_BR2B.ecs

  • Like 1
Link to comment
Share on other sites

Finally, here is Number Cruncher II.  This game also uses the AD&D Cloudy Mountain cartridge.  There is only one program this time, called NC2.

 

I made a few changes, not the least of which was to get rid of that awful noise.  There was one correction from the website though: apparently I forgot the line number after one of the GOTO commands.

 

How to play:

 

Use the keyboard to choose how many problems to solve.  For each problem, you will be presented with eight indexes and their values.  A random subset of values will be added together to make the Target number.  The object is to figure out which values add up exactly to the target.

 

Hold one of the keypad keys 0-7 on the left controller to select an index until an arrow appears next to that index, pointing to its value.  Hold that number again to deselect that index, making the arrow disappear.  Hold Clear to deselect all indexes.  Hold Enter when you think you've solved the problem.

 

You will be notified whether you were right or not.  Press and release the disc to start the next problem.  After all the problems, you are presented with the number of problems you got right and the total number of problems, plus the percentage.  Your final score is the percentage multiplied by 1 plus the number of problems attempted.  Points are deducted based on the amount of time taken, so I don't recommend playing at a faster speed.

ecs_tape_NC2.ecs

Link to comment
Share on other sites

So, about 21 years and one month ago, I got jzIntv running with SDL 0.10.  Yes, SDL wasn't even 1.0 yet when I moved to it from Allegro.

 

revision 1.9
date: 1999-05-03 02:10:01 -0500;  author: im14u2c;  state: Exp;  lines: +26 -24;
------------------------------------------------------------------------------
 05/03/1999 (jzbiciak)  release_006
------------------------------------------------------------------------------
 -- Finally got it building and running with SDL.  Suffered a minor setback
    in that I haven't integrated the horiz/vert delay and blanking bit
    support for the STIC yet, but that's only because I'm slowly redoing
    the STIC emulation the _right_ way.  :-)

    (BTW, it took me this long only because I've only had about 8-9 hours to
    spend on that, over half of which were discarded as I toyed around with
    various ideas on how to structure my code.  SDL isn't that difficult to
    use.)

    TODO:  It appears that the Football demo in the demo-cart runs
    incorrectly.  Must fix this!!!

 

This weekend, I'll at least release the sources for the SDL 2 port.  I haven't had time to do anything on Windows or Linux, so for now it's only available on Mac.  I might find some time this weekend for that as well.  If folks wanna help out, please do.  I expect it will be pretty minor actually, once I have SDL2 installed in both places.

 

And, of course, I've made a number of minor fixes to other things along the way.  Hopefully I can have a nice official 4th of July release on Linux/Mac/Windows, with both SDL1 and SDL2 builds.  I expect to retire the SDL1 builds at some point, though.

Link to comment
Share on other sites

11 hours ago, intvnut said:

This weekend, I'll at least release the sources for the SDL 2 port.  I haven't had time to do anything on Windows or Linux, so for now it's only available on Mac.  I might find some time this weekend for that as well.  If folks wanna help out, please do.  I expect it will be pretty minor actually, once I have SDL2 installed in both places.

I'll try compiling it in Termux with the SDL2 package and let you know whether it works or not.  If there's anything else I can do to help, just let me know.

Link to comment
Share on other sites

OK... I finally have a new version of jzIntv up on the website.  It took a few weekends' effort, but hopefully the result is worth it.

 

http://spatula-city.org/~im14u2c/intv/

 

Since the Christmas 2018 release, SVN tells me:  303 files changed, 21191 insertions(+), 14237 deletions(-)

 

About half of that was due to the SDL2 port:  121 files changed, 9264 insertions(+), 7954 deletions(-)

 

I still need to write up some release notes to catalog everything that's gone into jzIntv in the last 18 months.  In the meantime, download it and let me know if you run into issues. 

 

Linux users (including R-Pi):  I haven't had a chance to test what I've built.  Also, for Linux x86 users, you'll probably want to build the SDL2 port from source.

 

For folks hacking on the source:  Platforms that support both SDL1 and SDL2 have separate Makefiles for SDL1 and SDL2.  This may change eventually, but for now it's true.  Be sure to run make -f Makefile.foo clean if you switch between SDL1 and SDL2 in the same source tree.

 

On 6/6/2020 at 3:29 AM, jenergy said:

Sad to read this (for devices which have only SDL1, like WII), but this is the life. ?

I don't have immediate plans to remove the SDL1 support from the code.  But, at some point I'll stop releasing official SDL1 builds for platforms that support SDL2.

 

Hopefully, I haven't broken your Wii port too badly.  ?

 

On 6/6/2020 at 11:09 AM, Zendocon said:

I'll try compiling it in Termux with the SDL2 package and let you know whether it works or not.  If there's anything else I can do to help, just let me know.

You'll need to split Makefile.termux into Makefile.termux_sdl1 and Makefile.termux_sdl2 if you want to retain support for both.  Or, if everything works great with SDL2 and you don't care to carry SDL1 forward, just update Makefile.termux.  Hopefully it's as simple as: 

  • Change sdl-config to sdl2-config.
  • Add -DUSE_SDL2 to the CFLAGS.

If the SVN_xxx lines I added to the Makefile give you any issue, just comment them out.  The rest of the Makefile will cope.

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

Release notes:

Release notes for 2020-06-07.  (SVN r1996)
Updates since 2018-12-25.

---------------
 New features:
---------------

*   SDL2 support!  Thanks to Daniele Moglia for nudging me to get this done.
    *   New SDL2-specific keyboard events.  See doc/kbdhackfile.txt.

*   CHEAT support (thanks to Patrick Nadeau).  These allow you to bind keys
    to trigger "pokes" that change values in memory.  This is useful for,
    say, adding lives, becoming invincible, etc.  (TODO: document in
    doc/jzintv/cheat.txt).

*   Other kbdhackfile updates:
    *   Added new pause-related actions:
        *   PAUSE_ON always pauses; PAUSE_OFF always unpauses.
        *   PAUSE_HOLD pauses only while the input key is "down."
            Useful to tie to the HIDE event to auto-pause when minimized.
    *   WINDOW / FULLSC actions:
        *   WINDOW forces windowed mode.  Useful with SDL2 FOCUS_LOST event.
        *   FULLSC forces full-screen mode.
    *   SETMAPx, NEXTMAP, PREVMAP as clearer-named aliases for KBDx/KBDN/KBDP
    *   Added an example kbdhackfile with an alternate ECS keyboard map that's
        more useful on modern computer keyboards.

*   UTF-8 support in game metadata (ROM and BIN+CFG).

*   P macro in .CFG files can now poke paged ROM.

*   Added support for manipulating processor flags to 'g' debugger command.
    Registers numbers 8 - 13 manipulate the flags S, Z, O, C, I, D according to
    the LSB of value.

*   CP-1600X:
    *   Added examples/macro/cp1600x.mac.
    *   Added CP-1600X version of TagAlong Todd 2v.

----------
 Changes:
----------

*   AS1600
    *   Do not sign-extend characters >= 0x80 in STRING/DECLE declarations.
    *   Raise macro expansion limits by 10x.

*   Windows
    *   SDL1: The environment variable SDL_STDIO_REDIRECT controls whether
        jzIntv redirects stdout/stderr to files.  Set it to 0 to send these
        to "stdout.txt", "stderr.txt".
    *   Makefile.stdout is gone.  Use Makefile.w32_sdl1 or Makefile.w32_sdl2
        to build jzIntv.

*   MacOS:
    *   Builds are now 64-bit.
    *   Cmd-F toggles fullscreen/windowed mode.
    *   Cmd-W now closes the program on SDL2.  (Enforced by SDL2.)  Still
        toggles windowed mode on SDL1.

-------------------------
 Cleanups and bug fixes:
-------------------------

*   ROM / BIN handling>
    *   Better .ROM format detection in the presence of metadata tags.
    *   Improved string-quoting rules when generating CFG files.
    *   Use a common unquoter for CFG file parser and everywhere else.

*   Example/library code:
    *   cart.mac: Use EQU, not ORG to declare BYTEVAR/BYTEARRAY.
    *   Add missing library/jlp_accel.asm.
    *   Add macro/cp1600x.mac.

*   jzIntv general:
    *   You can power jzIntv off like an Intellivision II again.
    *   Hack to allow jzIntv SDL1 port to work on OS X Mojave and newer.
    *   Fix INTRQ regression (assert() failure).
    *   Restore JLP accelerator enable state across reset.
    *   Use <stdint.h> types rather than home-grown type aliases.
    *   Lots of type / const / restrict cleanups.
    *   Move color palettes out to their own file, and start to convert
        the rest of jzIntv to use the central infrastructure.
    *   Remove some moribund ports, such as MacOS Classic.
    *   Refactor event subsystem to have a common core, and an SDL-specific
        portion.  EVENT_xx enumeration no longer depends on SDL keycode values.
    *   Re-arm SIGWINCH signal handler in the right place.
    *   Add missing entries to joystick button and hat event tables for
        joysticks 4 through 9.
    *   Fixed some ECS key mappings for certain keys when shift is pressed.
    *   More robust paged-ROM loader in bincfg/legacy.c to handle paged RAM,
        and paged ROM segments that are declared piecemeal.
    *   Begin cleaning up all the global variables and narrowing module
        interfaces.
    *   Clean up stray debug printfs in bincfg_lexer ("BAD2", "BAD3").
    *   More MSVC compatibility fixes.
    *   Correctly map between voice/voice_compat in CFG metadata.
    *   Remove unnecessary uses of 'volatile'.

*   JzIntv debugger:
    *   Pokes to paged-ROMs now work correctly.
    *   Fix cycle skid on reaching a HLT instruction.

*   jzIntv CPU instruction decode cache invalidation fixes:
    *   Invalidate 2K of address space on Intellicart bankswitch.
    *   Invalidate paged-ROM flips correctly.

*   Minor bugfix encoding LUIGI files with paged memory that overlaps JLP
    accelerator memory.

-------
 Misc:
-------
*   Updated Emscripten to build with either SDL1 or SDL2.  Untested.

 

  • Thanks 1
Link to comment
Share on other sites

1 hour ago, intvnut said:

Release notes:


*   SDL2 support!  Thanks to Daniele Moglia for nudging me to get this done.

 

My pleasure ?

Thanks for this new release, I'm sure it will be easily ported again.

I tried SDL2 compilation on Windows, it seems all ok.

About key events: in older sources I implemented a 'combo' key management, that is clicking two keys together (or with a configurable delay..) is mapped as clicking another single key (example: pressing together keypad 2 and 4 results as pressing keypad 1) but maybe jzintv can already manage this behaviour? Maybe with the keyboard hack file management?

Link to comment
Share on other sites

6 hours ago, jenergy said:

About key events: in older sources I implemented a 'combo' key management, that is clicking two keys together (or with a configurable delay..) is mapped as clicking another single key (example: pressing together keypad 2 and 4 results as pressing keypad 1) but maybe jzintv can already manage this behaviour? Maybe with the keyboard hack file management?

jzIntv has support for defining up to 64 COMBO events involving 2 key presses, along with a configurable delay.  See "Combo Events" in doc/jzintv/kbdhackfile.txt.

 

  • 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...