Jump to content
IGNORED

Command Line Tools


Recommended Posts

For most carts, you can already do that via jaggd -ux demo.j64. It doesn't go through a normal boot process though, it just execs the code. It would be cool if the reset function had another mode though, where it reset without touching the ROM-space RAM and hence  booted the cartridge like it does when selecting a ROM from the menu, enabling a workflow like this:

# Wish this worked:
$ jaggd -u myrom,a:$800000  # Load a ROM
$ jaggd -rb # Reset GD and boot the ROM using the regular Jaguar boot process

But I assume that requires at least new firmware. In the meantime, you can try faking it using this tiny stub program I wrote using the JagGD Homebrew SDK (Which I stumbled upon after taking a look at the jaggd source) that calls GD_Reset(GD_RESET_NORMAL).

# This works sometimes, but not always. Why?
$ jaggd -rd -u mygame.rom # Reset to the debug stub and upload a ROM to $800000
$ jaggd -ux boottorom.cof 

You just upload your ROM to $800000+ with jaggd -u, then upload and exec boottorom.cof with jaggd -ux, and it boots your ROM using a normal boot flow through the Jaguar BIOS. Note this includes validating the ROM/checking the ROMs encryption, so be sure it has a valid header!

 

Sorry to keep editing this, but the above workaround only works sometimes. It seems flaky somehow, and I don't know why. YMMV. I've had it work 5 times in a row with different ROMs, then not work for several attempts. Very confusing.

 

boottorom.c boottorom.cof

Edited by cubanismo
Nope, still not working 100%
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

On 5/7/2022 at 9:09 AM, 42bs said:

Double this. Mean while I use a SD card expander to avoid wearing out the release mechanic in the GD. But during intro testing I need to rewrite the SD a dozen of times. 

Actually it would be cool to write directly into this RAM which holds the ROM for boot. And of course being able to start this via jaggd.

Same for booting a game by sending the name:

jaggd -b demo.j64

 

You can just specify $802000 as the load address and jump to that address to run from ROM.

 

I'll add the reboot and run option as well as write to memory card. I'm also investigating reliability issues now as well (started last week and have fixed a few things already).

  • Like 1
Link to comment
Share on other sites

New firmware available and new command line tool with changes requested.

 

https://github.com/RetroHQ/JagGDCmd/releases/tag/v1.01

 

jaggd [commands]

-r          Reboot
-rd         Reboot to debug stub
-rr         Reboot and keep current ROM
-wf file    Write file to memory card

From stub mode (all ROM, RAM > $2000) --
-u[x[r]] file[,a:addr,s:size,o:offset,x:entry]
            Upload to address with size and file offset and optionally eXecute directly or via Reboot.
            Prefix numbers with $ or 0x for hex, otherwise decimal assumed.
-e file[,size]
            Enable eeprom file on memory card with given size (in byes, default 128)
-x addr     Execute from address
-xr         Execute via reboot
-q          Quiet, use first to suppress all non-error messages

 

For the firmware hit OPTION on boot and put the URL in, but change the /fw/ bit to /bfw/ to grab this latest beta update. If everyone is happy I'll make it public.

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

Short feedback:

-uxr works quiet well, only one should not mix it with other modes. Means doing -r, -xr, -rd make the GD hang after a while (ok, one can call is mis-use).

 

Combination "-u file" + "-xr" works also.

 

Should jaggd stay in stub-mode after a "-rd"? Currently I need to use "-rd -uxr"

Link to comment
Share on other sites

47 minutes ago, 42bs said:

Short feedback:

-uxr works quiet well, only one should not mix it with other modes. Means doing -r, -xr, -rd make the GD hang after a while (ok, one can call is mis-use).

 

Combination "-u file" + "-xr" works also.

 

Should jaggd stay in stub-mode after a "-rd"? Currently I need to use "-rd -uxr"

 

I'll need to investigate further on odd hang still, but I'm glad it's otherwise working.

 

The stub mode is when the Jaguar is running the debug stub code and displaying the small RetroHQ logo. I need the code running on the Jaguar to be able to interact with it. So you'll need to do -rd before any time you want to upload data. The -wf option will work anywhere (more or less) as it doesn't need the Jaguar at all.

 

  • Thanks 1
Link to comment
Share on other sites

56 minutes ago, SainT said:

I need the code running on the Jaguar to be able to interact with it

Ah, ok. So it is possible, I somehow "destroy" the stub and this will prevent certain function from working.

Link to comment
Share on other sites

Some other issue I came across: I use an SD card expander. But since it does only provide the SD card signals the GD does not detect a change of SD card (guess it is a GPIO).

So maybe pressing "Option" or "Pause" could be used to force a re-read of the SD card.

 

BTW: I was taking the 0 in "(0) Version" as O like (O)ption.

 

Ah, and since there is a key-pad, how about short-cuts for the first 9 (ROM) entries?

Link to comment
Share on other sites

Thanks @SainT, this is great support for, as you say, something it's likely very few of us use ?

 

Since you're looking at things, I want to mention another issue I noticed: I've been messing with the SDK/Homebrew interface a lot the last few days (Hopefully I'll have a cool demo to share soon. Needs more debugging first), but one thing I've noticed is if I use the SD file interface, I have roughly a 0% chance of the debug stub being usable after a reboot. It just hangs when I try to upload stuff. I have to hard power cycle instead. I'm using the GPU-based GD_FRead() command for the most part, both the synchronous and asynchronous variants, and my code ends with crashes right now, so it's definitely possible I'm leaving things in a bad state, but I would have hoped a reset of the Jaguar would reset the portions of the interface on the GD side that deal with it sufficiently for communication to work again as well. As-is, it's not a huge deal, just adds a little time to each debug cycle and puts a little wear on my power button. Now that I've worked out the semantics of the async operations, the SD card access itself appears to be very reliable.

Link to comment
Share on other sites

51 minutes ago, cubanismo said:

Thanks @SainT, this is great support for, as you say, something it's likely very few of us use ?

 

Since you're looking at things, I want to mention another issue I noticed: I've been messing with the SDK/Homebrew interface a lot the last few days (Hopefully I'll have a cool demo to share soon. Needs more debugging first), but one thing I've noticed is if I use the SD file interface, I have roughly a 0% chance of the debug stub being usable after a reboot. It just hangs when I try to upload stuff. I have to hard power cycle instead. I'm using the GPU-based GD_FRead() command for the most part, both the synchronous and asynchronous variants, and my code ends with crashes right now, so it's definitely possible I'm leaving things in a bad state, but I would have hoped a reset of the Jaguar would reset the portions of the interface on the GD side that deal with it sufficiently for communication to work again as well. As-is, it's not a huge deal, just adds a little time to each debug cycle and puts a little wear on my power button. Now that I've worked out the semantics of the async operations, the SD card access itself appears to be very reliable.

Yep, if you get the cart into a bad state it will not accept any more instructions and therefore not reset. If you can provide examples which are hanging the GD but you think they should not I will look into why.

Link to comment
Share on other sites

2 hours ago, 42bs said:

Some other issue I came across: I use an SD card expander. But since it does only provide the SD card signals the GD does not detect a change of SD card (guess it is a GPIO).

So maybe pressing "Option" or "Pause" could be used to force a re-read of the SD card.

 

BTW: I was taking the 0 in "(0) Version" as O like (O)ption.

 

Ah, and since there is a key-pad, how about short-cuts for the first 9 (ROM) entries?

I was thinking a refresh would be handy myself. The -wf works when the menu is running, so a refresh would be useful if you just want to upload ROMs this way. The card change is detected by the physical insertion of the card on the card socket.

Link to comment
Share on other sites

31 minutes ago, Chilly Willy said:

I checked the link from the cart and it says it's still the latest firmware.

 

5 hours ago, SainT said:

For the firmware hit OPTION on boot and put the URL in, but change the /fw/ bit to /bfw/ to grab this latest beta update. If everyone is happy I'll make it public.

 

  • Like 2
Link to comment
Share on other sites

12 minutes ago, SainT said:

Yep, if you get the cart into a bad state it will not accept any more instructions and therefore not reset. If you can provide examples which are hanging the GD but you think they should not I will look into why.

I want to clarify it *does* reboot, and shows the debug stub small logo screen. It just doesn't seem to accept commands afterwards, as if some link in the chain is locked up or out of sync or something.

 

I'll try to put together something usable by others shortly that demonstrates this. Right now I have a jaguar program and some files it depends on that I don't have the right copyrights to share, so I'll have to make something more minimal.

  • Like 2
Link to comment
Share on other sites

hello

 

thanks for the improvments !

 

i did some test with writing file, and i got :

 

$ ./jaggd.exe  -wf scrolling1.abs
WRITE FILE (scrolling1.abs)... OK!

 

$ ./jaggd.exe  -wf scrolling1_jiffi.rom
WRITE FILE (scrolling1_jiffi.rom)... OK!

 

but no file listed in the GD menu, even after -r and -rd + -r reboots

i tried with also the .rom version of the file

 

i put the SD in my PC and i have some stange files named ")" , "∩" and "▀" 

 

the file was not already present on the SD

 

renaming "∩" for example to .abs , and it is working in the GD menu

 

 

Link to comment
Share on other sites

2 hours ago, Ericde45 said:

but no file listed in the GD menu, even after -r and -rd + -r reboots

Saw the same but different letters and thought this command is to save Memory Card files not for ROM files.

Link to comment
Share on other sites

Works, _but_, directory is not reloaded. So it needs a "jaggd -r".

(But for the development-cycle it is sufficient, as for example, I write always a.j64.)

 

Just discovered, "4"/"6" jump to top/bottom of the list ?

Edited by 42bs
  • Like 1
Link to comment
Share on other sites

10 minutes ago, 42bs said:

Works, _but_, directory is not reloaded. So it needs a "jaggd -r".

(But for the development-cycle it is sufficient, as for example, I write always a.j64.)

 

Just discovered, "4"/"6" jump to top/bottom of the list ?

Yeah, just a quick command line tool fix, not touched the menu.

 

You can always do --

 

jaggd -wf somefile.rom -r

 

If you want to reboot to the (refreshed!) menu. Execute from memory card could also be a handy feature? Something like --

 

jaggd -wf somefile.rom -rd -x somefile.rom

 

To load the ROM from memory card then reboot execute.

 

I'll get on to the other bits as well shortly.

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

11 minutes ago, 42bs said:

Just discovered, "4"/"6" jump to top/bottom of the list ?

Those are the L/R bumpers on a pro controller, that's the same as A+UP/DOWN (page up / down). You also have other listing movement options on A+??.

  • Thanks 1
Link to comment
Share on other sites

19 minutes ago, Ericde45 said:

execute the loaded file would be welcome

I thought the same, but "-uxr" does what it needs.

 

But yes, a "jaggd -rd -fxr <name.j64>" whould be nice as well. No need to switch from keyboard to joypad.

("f" for file instead of "-u" for upload).

Link to comment
Share on other sites

Yes, for the most part just using -ux or -uxr should do what you need. It's only if you happened to have separate data on the memory card and a static executable ROM that it becomes useful to upload the ROM once to memory card then run it multiple times.

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