Hi Folks,
I'm writing to ask for some help to convert Zanac-Ex BIN files so as NOT to use the BASIC loader provided with the game, as I'm using a different DISK boot-loader which displays a list of games when the MSX boots.
Usually, MSX BIN files have some sort of code at the end where the execution starts, so I need to convert Zanac-Ex BIN files to that format, which seems to be compatible with the boor loader I'm using. The code at the end varies depending on the MSX games, but for instance, for the first BIN file of Arkanoid is something like:
ld a,#54
out (#a8),a
ld hl,#9000
ld bc,#4000
ld de,#4000
ldir
ld a,#50
out (#a8),a
ret
However, Zanac-Ex BIN files have no code to execute at the end and the header of its BIN files are like:
FE 0090 FFCF 0090
Start: 0x9000
End: 0xCFFF
Exec: 0x9000
The thing is the loader I'm using can't properly load Zanac-Ex BIN files as they are, since there is no executable code at 0x9000 for some of the BIN files. For instance, ZANAC-EX.1 starts with the AB ROM signature:
AB.ACOM CG-86013
41 42 00 41 43 4F 4D 20 43 47 2D 38 36 30 31 33
Is there any way to change Zanac-Ex BIN files so as NOT to load the game from BASIC? Unfortunately, I cannot provide much information about the loader I'm using as I'm not the developer, but i is compatible with BIN files that features some executable code at the end, so I need to convert Zanac-Ex BIN files to such a format.
This is the link of the Zanac-EX DSK I'm trying:
{mod: sorry, warezlink removed}
The BASIC loader can be found inside the DSK image and is divided into two different BASIC files ZANAC-EX.BAS and ZANAC-EX.0.
ZANAC-EX.BAS:
30 A%=&HC000 40 POKE A%,0 50 A%=A%+1 60 POKE &HF676,PEEK(VARPTR(A%)) 70 POKE &HF677,PEEK(VARPTR(A%)+1) 80 RUN"ZANAC-EX.0"
ZANAC-EX.0:
11 WIDTH40:CLS:KEYOFF
12 PRINT"ZANAC EX(MSX2 GAME).DEPLOMBE PAR X.M.V":PRINT
14 PRINT" AN EXCELLENT GAME OF COMPILE/PONYCA "
16 PRINT"ORIGINAL VERSION AVAILABLE ON CARTRIDGE"
18 PRINT" WITH A SIZE OF 1 MBit or 128 Kb."
20 PRINT"THIS RAM VERSION NEEDS 128 KB MEMORY "
22 PRINT"MAPPER AT LEAST AND HAS TO BE USED ONLY"
24 PRINT"FOR STUDYING AND TESTING THE MAPPER."
26 PRINT:PRINT" MACHINES WITH 128 KB OR MORE ARE:"
28 PRINT" - SONY HB-F700P, G900P, HB-F9P"
30 PRINT" - PHILIPS VG8235,NMS 8245,NMS 8250,"
31 PRINT" NMS 8255, NMS 8280"
32 PRINT" - YAMAHA YIS 805/256. C7M/128 ,AMO"
33 PRINT" - OR MACHINES WITH A SEPERATE MEMORY"
34 PRINT" MAPPER WHICH >=128 KB."
35 PRINT" ONE CONDITION: THIS MAPPER HAS"
36 PRINT" TO BE PLACED BEFORE NORMAL RAM !"
38 PRINT:PRINT" NOW HARDWARE TESTING......."
40 IF PEEK(&H2D)<1 THEN PRINT"THIS HAS TO BE A MSX2 COMPUTER AT LEAST. SORRY.":END
100 OUT&HFE,1:OUT&HFD,2:IFINP(&HFE)=INP(&HFD)THENPRINT"THIS MACHINE HAS NO (WORKING?) MEMORY MAPPER. SORRY.":END
101 PRINT "240 LIVES (Y/N)";
102 INPUT Z$
103 PRINT "INVINCIBILITY (Y/N)";
104 INPUT Y$
110 FORT=1TO255:OUT&HFE,T:POKE&HBFFE,0:NEXT:T=1
120 OUT&HFE,T:A=PEEK(&HBFFE):IF(A=T)ORA=0THENPOKE&HBFFE,TELSEGOTO140
130 T=T+1:GOTO120
140 OUT&HFE,1:IFT<9THENPRINT"TOO LITTLE MEMORY. SORRY.":END
142 PRINT:PRINT"..LOADING NOW AND STARTING.."
148 'FORT=1TO7:OUT&HFE,T:BLOAD"ZANAC-EX."+RIGHT$(STR$(T),1),-&H1000:IF( (A$=CHR$(89)ORA$=CHR$(121)) AND (T=1)) THEN POKE&H9A05,&HF0:IF( (B$=CHR$(89)ORB$=CHR$(121)) AND (T=7)) THEN POKE&H9B55,&H0:POKE&H9B56,&H0:POKE&H9B57,&H0:LOCATE37,21:PRINT7-T:NEXTT
149 FORT=1TO7:OUT&HFE,T
155 BLOAD"ZANAC-EX."+RIGHT$(STR$(T),1),-&H1000
156 IFT=1AND(Z$=CHR$(89)ORZ$=CHR$(121))THENPOKE(&H9A05-&H1007),&HF0
157 IFT=7AND(Y$=CHR$(89)ORY$=CHR$(121))THENPOKE(&H9B55-&H1007),&H0:POKE(&H9B56-&H1007),&H0:POKE(&H9B57-&H1007),&H0
158 LOCATE37,21:PRINT7-T:NEXTT
159 RESTORE 320:FORT=&HD000TO&HD039:READA$:POKE T,VAL("&H"+A$):NEXTT
190 RESTORE200:FORT=&HCE00TO&HCE19:READA$:POKET,VAL("&H"+A$):NEXTT
191 POKE&HCE0F,PEEK(&HF341)
195 OUT&HFE,1:OUT&HFD,2:DEFUSR=&HCE00:PRINTUSR(0)
200 DATA 01,00,04,F3,C5,CD,9F,FD,C1,0B,78,B1,20,F5,3e,00,21,00,50,CD,24,00,2a,02,40,e9
320 DATA F5,FE,6,20,4,3E,7,18,2D,FE,7,20,27,C3,30,D0,F5,FE,6,20,4,3E,7,18,A,FE,7,20,4,3E,1,18,2,3C,3C,D3,FE,F1,C9,0,0,0,0,0,0,0,0,0,3E,1,18,2,3C,3C,D3,FD,F1,C9,Considering what the BASIC loader above does (forget the INVINCIBILITY issue), what a binary file is supposed to do in order to load the game?
Cheers,
CJ
