Skip to content

Commit

Permalink
automatic banks support for GBDK-2020 export in GBMB
Browse files Browse the repository at this point in the history
  • Loading branch information
untoxa committed Jul 13, 2021
1 parent 18ef43a commit dfd5265
Showing 1 changed file with 14 additions and 20 deletions.
34 changes: 14 additions & 20 deletions gbmb/Exportclass.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1105,22 +1105,19 @@ procedure TGBDKMapExport.WritePlaneLabel( i, Block : integer);
else
s := Trim(Options.Labelname) + 'BLK' + IntToStr(Block);

if (i = 0) then
begin
if (i = 0) then begin
writeln(F);
if (Options.PlaneOrder = 0) then
begin
if (Options.PlaneOrder = 0) then begin
if (Options.Bank <> 0) then writeln(F, format('const void __at(%d) __bank_%s;', [Options.Bank, s]));
writeln(F, 'const unsigned char ' + s + '[] =');
end
else
begin
end else begin
writeln(F, '#define ' + s + ' ' + s + 'PLN0' );
if (Options.Bank <> 0) then writeln(F, format('const void __at(%d) __bank_%sPLN0;', [Options.Bank, s]));
writeln(F, 'const unsigned char ' + s + 'PLN0[] =');
end
end
else
begin
end else begin
WriteBlockEnd;
if (Options.Bank <> 0) then writeln(F, format('const void __at(%d) __bank_%sPLN0%d;', [Options.Bank, s, i]));
writeln(F, 'const unsigned char ' + s + 'PLN' + IntToStr(i) + '[] =');
end;
writeln(F, '{');
Expand Down Expand Up @@ -1219,20 +1216,17 @@ procedure TGBDKIncMapExport.WritePlaneLabel( i, Block : integer);
else
s := Trim(Options.Labelname) + 'BLK' + IntToStr(Block);

if (i = 0) then
begin
if (Options.PlaneOrder = 0) then
begin
if (i = 0) then begin
if (Options.PlaneOrder = 0) then begin
if (Options.Bank <> 0) then writeln(F, format('extern const void __bank_%s;', [s]));
writeln(F, 'extern const unsigned char ' + s + '[];');
end
else
begin
end else begin
writeln(F, '#define ' + s + ' ' + s + 'PLN0' );
if (Options.Bank <> 0) then writeln(F, format('extern const void __bank_%sPLN0;', [s]));
writeln(F, 'extern const unsigned char ' + s + 'PLN0[];');
end
end
else
begin
end else begin
if (Options.Bank <> 0) then writeln(F, format('extern const void __bank_%sPLN0%d;', [s, i]));
writeln(F, 'extern const unsigned char ' + s + 'PLN' + IntToStr(i) + '[];');
end;
end;
Expand Down

0 comments on commit dfd5265

Please sign in to comment.