Rasmus-M / js99er-angular

TI-99/4A emulator written in TypeScript using Angular
35 stars 11 forks source link

[bug/feature] cartUrl not loading/running my homebrew games from GitHub repository #67

Open Fabrizio-Caruso opened 20 hours ago

Fabrizio-Caruso commented 20 hours ago

Hi! I have managed to build .bin cartridge images but I am not able to load it with your emulator with the url parameter cartUrl parameter. The cart image works fine with Classic99 and JS99er if load it with LoadCart.

One such cart image is here: https://github.com/Fabrizio-Caruso/CROSS-LIB/releases/download/trexBETA/XTREX18.bin

I have the same problems with the my other games.

I have tried both with http and https. None of them has worked:

https://js99er.net/#/?cartUrl=http:%2F%2Fgithub.com%2FFabrizio-Caruso%2FCROSS-LIB%2Freleases%2Fdownload%2FtrexBETA%2FXTREX18.bin

https://js99er.net/#/?cartUrl=https:%2F%2Fgithub.com%2FFabrizio-Caruso%2FCROSS-LIB%2Freleases%2Fdownload%2FtrexBETA%2FXTREX18.bin

Should I use http or https?

P.S.: I think GitHub repositories are not using re-direction. Other JS emulators work fine with GitHub. For example:

https://nippur72.github.io/laser500emu/?load=http://github.com/Fabrizio-Caruso/CROSS-LIB/releases/download/trexBETA/Xtrex_laser500_keyboard.bin

hippietrail commented 12 hours ago

I just had a look at XTREX18.bin with my own project, which is support for reverse-engineering retro software in Ghidra.

I know .bin files like to have a last letter before the . that indicates what type it is. Most commonly g for GROMs and c for machine code ROMs.

My tool defaults to GROM if this letter is not present. But when it's loaded it doesn't seem to make much sense as GPL code so I loaded it as TMS-9900 machine code and that looks a lot more plausible.

So maybe js99er-angular makes a similar assumption?

(I'm not a TI-99 guy and don't know what other emulators do in this situation)

View of the file as GPL:

                      GPL_entry                             XREF[1]:  Entry Point(*)  
         6038 07 20                       ALL         >0x20
         603a 60 00                       BS          >0x6000
         603c 03                          SCAN
         603d 00                          RTN
         603e 00                          RTN
         603f 00                          RTN
         6040 02 e0                       RAND        >0xe0
         6042 83 00                       DNEG        @>0x8300
         6044 02 00                       RAND        >0x0

View of the file as TMS-9900 code:

                      GPL_entry                             XREF[1]:  Entry Point(*)  
         6038 07 20 60 00                 SETO        SYM@>0x6000
         603c 03 00 00 00                 LIMI        >0x0
         6040 02 e0 83 00                 LWPI        >0x8300
         6044 02 00 12 34                 LI          r0,>0x1234
         6048 c8 00 a0 00                 MOV         r0,@>0xa000
         604c 80 20 a0 00                 C           SYM@>0xa000,r0
         6050 16 32                       JNE         >LAB_60b6
         6052 02 00 83 20                 LI          r0,>0x8320
         6056 02 01 60 7a                 LI          r1,>0x607a
         605a 02 02 00 3c                 LI          r2,>0x3c
                      LAB_605e                              XREF[1]:  6062(j)  
         605e cc 31                       MOV         *r1+,*r0+
         6060 06 42                       DECT        r2
         6062 16 fd                       JNE         >LAB_605e
         6064 02 0c 60 26                 LI          r12,>0x6026
         6068 06 a0 83 20                 BL          SYM@>0x8320
         606c 02 2c 00 08                 AI          r12,>0x8
         6070 06 a0 83 20                 BL          SYM@>0x8320
         6074 c0 20 60 36                 MOV         SYM@>0x6036,r0
         6078 04 50                       B           *r0
Fabrizio-Caruso commented 11 hours ago

@hippietrail js99er can load this cart image with the "normal" load cart option. It just fails to load and run it when it is loaded through the url parameter cartUrl. So I think that the problem is in the way js99er imports data from GitHub repositories.