Was able to add the java/src folder if choosing for new project -> Java with Ant -> Java Application (NetBeans 17)
Copy all folders in the root folder of the project and finally able running main.java and it started filling the autogenerated folder (keep folder structure! I removed everything in the folder first time and that caused errors)
Java project seemed finished ok but when compiling the rom I got errors, autogenerated\music folder was empy
Inspecting project files I see an exclamation mark at file TSVMusic.java and on line 109 and warnings on line 104/130/136 (with the file dump from github, not tested the source zip)
[edit]Adding the jar files in java/lib folder to the project library did remove the errors and warnings in the TSVMusic.java file but after running main,java the music folder is still empty. Did a file compare with the autogenerated folder from github and in the other folders also more files are not generated. No clue what can be wrong
I just downloaded your zip file and looked at the doc, with the diffs, etc.:
- The difference between the .rom you generate and the official one is very puzzling. The output you get in the terminal is all correct, and exactly what you should get. However, the differences in the .rom that you are getting are in the "compressed-code1.zx0", "compressed-code2.zx0" and "compressed-code3.zx0" files. The only thing I can think of is that you are using zx0 v2.2, and back when I did the game, I was using v1.5. Maybe they are incompatible?
- As for the Java thing, what "working folder" are you setting when you run it, and what output do you get in the console?
Starting from zx0 version 2, the encoding is different from previous versions. It's still possible to use the old encoding by adding the -c flag to the program's arguments.
All this while more niche compressors like zx0 definitely have downsides, such as lack of availability in standard packages, lack of prebuilt binaries for certain OS-es, lack of documentation, much slower compression, and also the OWCC compiler dependency for zx0 is unusual and an additional obstacle to include it in a build process, not a big fan.
Maybe I'm missing something, but I find the ZX0 documentation to be enough (compression modes, parameters, file structure...). For the slow compression and binaries for other systems, there are several alternatives, such as the faster implementation in portable C (salvador) and multi-threaded implementations in Java and Kotlin.
The only thing I can think of is that you are using zx0 v2.2, and back when I did the game, I was using v1.5. Maybe they are incompatible?
Yes. From the ZX0 documentation:
WARNING: The ZX0 file format was changed in version 2. This new format allows decompressors to be slightly smaller and run slightly faster. If you need to compress a file to the old "classic" file format from version 1, then execute ZX0 compressor using parameter "-c".
Ah! That explains! And I should update my utility code to use the new version
Confirmed!, zx0 with -c flag in the build file created a working rom file, hex compare showed zero difference
Thnx for the tip @Arjan
Going to look to the java autogenerated folder asap, hopefully also a little "issue" and maybe just al setup thing in the Java IDE Netbeans.
Aha! Cool! I just added a note on the readme file in github to clarify this! Thanks everyone for the help and comments!
@santiontanon
Added -c flag to line 30 in ZX0Wrapper.java
Added TSVMusic.main(args); to Main.java (Music folder is filled with the needed files now)
Optional added TextPTBR.main(args); to Main.java (for brazilian text? not tested further)
In Netbeans added all 3 .jar files in /java folder to the project Libraries and run Main.java
Above generated almost all the files in the Autogenerated folder compared with the downloaded folder.
Feeling lucky just started building the english rom, hex compared with the downloaded rom and success!
nice!!! Glad it all worked out, and good that you tried it! I learned about the zx0 version change thanks to this
You Can help me ,i search a program for do rom with a bin file.
Thank you.