Comments (12)
Actually, the filename is intended to be uppercase: https://github.com/z88dk/z88dk/blob/master/src/appmake/c128.c#L71
So, it's Cygwin causing a bit grief - can you do a compile with -v so I can see what commands are being run?
from z88dk.
@suborb but what appmake generates under Linux won't work with c1541 unless renamed to small letters because the loader expects a non-shifted file name in the disk image (non-shifted is shown either as small letters in small+capital char set or as capital in capital+graphics depending on the Petscii mode).
Do you really mean that -create-app -o"a40.bin"
is supposed to generate capitalized A40
and A40.LDR
where the A40.LDR
expects a small letter file name?
How should I rewrite the makefile target in order to get it to work under Linux and possibly any Posix environment?
from z88dk.
I think the problem is that appmake assumes small (un-shifted PETSCII) letters in the file name to be used in the loader:
z88dk-appmake +c128 --disk -b "a40.bin" -c "a40"
c1541 -format "crosschase,0" d64 FULL_c128_z80_40col.d64
formatting in unit 8 ...
c1541 -attach FULL_c128_z80_40col.d64 -write "a40.LDR"
cannot read file `a40.LDR': No such file or directory
cannot read file
make: *** [Makefile_common:858: c128_z80_40col] Error 1
New binaries built: 0
but it generates capitalized files, which once put inside the disk images won't match with the loader.
Indeed I can load the game if I edit the BASIC loader.
For some unknown reason, I don't have this problem in Cygwin/Windows where appmake seems to follow the capital/small type passed with -o
.
Remark:
You can reproduce this in Cross-Lib with: xl bomber c128
(as long as c1541 is also installed together with the other deps such as Python, Makefile and maybe gcc).
from z88dk.
For some unknown reason, I don't have this problem in Cygwin/Windows where appmake seems to follow the capital/small type passed with
-o
.
I think we're talking slightly at cross purposes. It looks like appmake is deliberately uppercasing the filename. This uppercased version is then used in the loader and the filename.
It's not a solution, but the following is a hint as to what's going on.
I've managed to recreate something similar on macOS which has a case-insensitive but preserving filesystem as does windows. Compare the outputs of the following commands:
zcc +c128 world.c -create-app -o boobar.bin -Cz-d
Yields: boobar.bin BOOBAR and BOOBAR.LDR
zcc +c128 world.c -create-app -o bobber -Cz-d
Yields: boobar and BOOBAR.LDR
In both cases, BOOBAR.LDR contains "BOOBAR" as the filename - that should be the same for you.
There's obviously something going wrong here - I think we might have to force an remove
before writing the output file to sort out these ambiguities.
from z88dk.
If I do as above, under Cygwin/Windows:
c128_z80_40col: $(ASSETS_PATH)/z88dk_xchase.asm
$(Z88DK_PATH)$(MYZ88DK) +c128 $(SCCZ80_OPTS) \
$(INCLUDE_OPTS) \
-lndos -subtype=disk -clib=gencon \
-D__C128_Z80__ -DXSize=40 \
\
-D__BIT_BANG_SOUND \
-D_XL_SLOW_DOWN_FACTOR=$(_COMMON_SLOWDOWN_FACTOR)*$(_C128_Z80_40COL_SLOWDOWN) \
-D__CONIO_GRAPHICS \
$(FULL_FILES) \
$(ASSETS_PATH)/z88dk_xchase.asm \
$(CROSS_LIB_PATH)/display/init_graphics/z88dk/udg/udg_init_graphics.c \
-create-app -o a40 -Cz-d
ifdef USE_TOOLS
$(C1541) -format "crosschase,0" d64 [email protected]
$(C1541) -attach [email protected] -write A40.LDR
$(C1541) -attach [email protected] -write A40
mv [email protected] $(BUILD_PATH)/X$(GAME_NAME)[email protected]
else
mv A40 $(BUILD_PATH)/X$(GAME_NAME)[email protected]
endif
rm A40.LDR
rm A40
I get the unshifted file name (shown as capital in standard PETSCII mode, which means small in small+capital mode) inside the loader. So it produces an error with the loader:
from z88dk.
P.S.: In standard PETSCII mode a capital file name should look like this (I have edited manually):
from z88dk.
@suborb, I get the same problem under Unix.
appmake is storing unshifted file names in the loader.
Remark: "unshifted" looks like "capital" letters in the standard PETSCII mode, which is maybe why you say it is capital letters, but it is not. It is basically a small letter file name.
from z88dk.
Right, I've finally setup Vice and I can see what's going on and it's a little painful.
- So the filename in the loader is correct - it's using code points 0x41 -> 0x5a to represent the letters.
- The output filenames should be in lower-case or c1541 prints garbage and creates a garbage name in the d64 directory when you attach them
So, the generated binaries are correct, they're just named incorrectly. We've still got a question as to why Cygwin generated lower case binary names, but somehow that made things work.
from z88dk.
Yes, Cygwin for some reason was forcing the binary files to be in lower case and so it worked with the loader by coincidence.
Any way, I can now generate upper case binaries on both Cygwin and Linux. So if your latest commits aligns the binary with the loader, everything should work fine.
from z88dk.
Tested KO under Cygwin. It is now a bit worse because -o a40 produces an error about input and output file having the same name. So I must use -o a40.bin.
PROBLEM: appmake generates upper case binaries but the loader expects lower case (as before).
MY SUGGESTED SOLUTION: change the loader to expect capitalized binaries.
Reminder:
actual upper case (shifted) A
is the ace of spades character in default PETSCII mode.
actual lower case (unshifted) A
is shown as upper case A
in default PETSCII mode.
My Makefile target is:
c128_z80_40col: $(ASSETS_PATH)/z88dk_xchase.asm
$(Z88DK_PATH)$(MYZ88DK) +c128 $(SCCZ80_OPTS) \
$(INCLUDE_OPTS) \
-lndos -subtype=disk -clib=gencon \
-D__C128_Z80__ -DXSize=40 \
\
-D__BIT_BANG_SOUND \
-D_XL_SLOW_DOWN_FACTOR=$(_COMMON_SLOWDOWN_FACTOR)*$(_C128_Z80_40COL_SLOWDOWN) \
-D__CONIO_GRAPHICS \
$(FULL_FILES) \
$(ASSETS_PATH)/z88dk_xchase.asm \
$(CROSS_LIB_PATH)/display/init_graphics/z88dk/udg/udg_init_graphics.c \
-create-app -o a40.bin -Cz-d
ifdef USE_TOOLS
$(C1541) -format "crosschase,0" d64 [email protected]
$(C1541) -attach [email protected] -write A40.LDR
$(C1541) -attach [email protected] -write A40
mv [email protected] $(BUILD_PATH)/X$(GAME_NAME)[email protected]
rm a40.bin
else
mv a40.bin $(BUILD_PATH)/X$(GAME_NAME)[email protected]
endif
rm A40.LDR
rm A40
The compilation works but the file name in the loader is the same as before (i.e., unshifted = lower case in alternate PETSCII mode even though it is shown as upper case in standard PETSCII mode).
I can make the loader work if I edit "A" -> shifted A (ace of spades character in default PETSCII mode)
from z88dk.
So, I've no idea what's going on here - your project works for me after a small change:
@@ -840,7 +840,7 @@ c128_z80_40col_zsdcc: $(ASSETS_PATH)/z88dk_xchase.asm
-create-app -o"a40.bin"
ifdef USE_TOOLS
$(C1541) -format "crosschase,0" d64 [email protected]
- $(C1541) -attach [email protected] -write a40.LDR
+ $(C1541) -attach [email protected] -write a40.ldr
$(C1541) -attach [email protected] -write a40
mv [email protected] $(BUILD_PATH)/X$(GAME_NAME)[email protected]
rm a40.bin
@@ -867,7 +867,7 @@ c128_z80_40col: $(ASSETS_PATH)/z88dk_xchase.asm
-create-app -o"a40.bin"
ifdef USE_TOOLS
$(C1541) -format "crosschase,0" d64 [email protected]
- $(C1541) -attach [email protected] -write a40.LDR
+ $(C1541) -attach [email protected] -write a40.ldr
$(C1541) -attach [email protected] -write a40
mv [email protected] $(BUILD_PATH)/X$(GAME_NAME)[email protected]
rm a40.bin
Volumes/vice-arm64-gtk3-3.8/vice-arm64-gtk3-3.8/bin/c1541 -format "crosschase,0" d64 FULL_c128_z80_40col.d64
/Users/dom/z88dk/CROSS-LIB/src
formatting in unit 8 ...
/Volumes/vice-arm64-gtk3-3.8/vice-arm64-gtk3-3.8/bin/c1541 -attach FULL_c128_z80_40col.d64 -write a40.ldr
/Users/dom/z88dk/CROSS-LIB/src
writing file `A40.LDR' as `A40.LDR' to unit 8
/Volumes/vice-arm64-gtk3-3.8/vice-arm64-gtk3-3.8/bin/c1541 -attach FULL_c128_z80_40col.d64 -write a40
/Users/dom/z88dk/CROSS-LIB/src
writing file `A40' as `A40' to unit 8
mv FULL_c128_z80_40col.d64 ../build/Xchase_c128_z80_40col.d64
% hexdump -C ../build/Xchase_c128_z80_40col.d64
...
00015000 00 2a 01 1c 09 1c 0a 00 fe 02 30 00 17 1c 14 00 |.*........0.....|
00015010 fe 11 22 41 34 30 22 2c 42 30 00 17 1c 32 00 9e |.."A40",B0...2..|
00015020 32 30 34 38 30 3a 80 00 00 00 00 00 00 00 00 00 |20480:..........|
00015030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
...
00016530 15 ff ff 1f 15 ff ff 1f 15 ff ff 1f 01 00 00 08 |................|
00016540 00 00 00 00 00 00 00 00 11 fc ff 07 13 ff ff 07 |................|
00016550 13 ff ff 07 13 ff ff 07 13 ff ff 07 13 ff ff 07 |................|
00016560 13 ff ff 07 12 ff ff 03 12 ff ff 03 12 ff ff 03 |................|
00016570 12 ff ff 03 12 ff ff 03 12 ff ff 03 11 ff ff 01 |................|
00016580 11 ff ff 01 11 ff ff 01 11 ff ff 01 11 ff ff 01 |................|
00016590 43 52 4f 53 53 43 48 41 53 45 a0 a0 a0 a0 a0 a0 |CROSSCHASE......|
000165a0 a0 a0 30 20 a0 32 41 a0 a0 a0 a0 00 00 00 00 00 |..0 .2A.........|
000165b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00016600 00 ff 82 11 00 41 34 30 2e 4c 44 52 a0 a0 a0 a0 |.....A40.LDR....|
00016610 a0 a0 a0 a0 a0 00 00 00 00 00 00 00 00 00 01 00 |................|
00016620 00 00 82 11 01 41 34 30 a0 a0 a0 a0 a0 a0 a0 a0 |.....A40........|
00016630 a0 a0 a0 a0 a0 00 00 00 00 00 00 00 00 00 3d 00 |..............=.|
00016640 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
0002ab00
Can you attach the d64 and the two a40 files you're generating, and I'll compare them.
from z88dk.
Thanks! I have now been able to test your solution after a minor change to my Makefile.
It now works perfectly on both Cygwin/Windows and Ubuntu (Lubuntu 21.10) with the very same Makefile.
from z88dk.
Related Issues (20)
- (z80asm) Pseudo instructions causing trouble HOT 3
- (sccz80) Const initialisation issue HOT 1
- 2.2 does not compile on Fedora 40 HOT 4
- [question] How is z88dk making it possible to parallely build several targets sharing some code? HOT 3
- [bug?] Z88DK versions from the same date: Linux version fails while Windows version is OK HOT 7
- [bug][zx81][wrx] When compiling for zx81 with wrx I now get `undefined symbol: hrg_phase` HOT 11
- Thank you 🙂 HOT 1
- msys2 issues: clang64 error compiling and compiler path errors HOT 3
- [feature] Support for Olivetti m10 (clone of m100) HOT 22
- (z80asm) Compile issue on msys2
- ASSERT on Z80asm HOT 2
- Compile error today (worked yesterday) HOT 1
- MacOS - zsdcc binary is r14210 HOT 3
- appmake +zx colliding with binaries of previous builds
- TMS9918 graphics improvements HOT 6
- [question][ti] What is the meaning of "Warning: Use of numbers in the variable name is not certain to work on all calculators!" ? HOT 2
- (sccz80) Support static __far data
- [zx81][feature] WRX96 and/or WRX128 with centered display? HOT 1
- sccz80 - lhs constant comparison HOT 6
- 8085 - l_eq l_ne operator optimisation HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from z88dk.