Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reworked the build scripts #4

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
**/*.lst
**/*.map
**/*.o
4 changes: 0 additions & 4 deletions COMPILING.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@ This uses a very old version of the Gameboy Development Kit (GBDK) which has som
WINDOWS:

Copy the "sdk" branch to the root of a main drive (e.g. C:\sdk, D:\sdk, etc)
cd /d c:\sdk\gbz80-gb\2-1-5\lib
make
cd /d c:\sdk\gbz80-gb\2-1-5\examples\u3
make

LINUX:

Copy/symlink the "sdk" branch to root directory, then:
cd /sdk/gbz80-gb/2-1-5/lib
wine cmd /c make.bat
cd /sdk/gbz80-gb/2-1-5/examples/u3
wine cmd /c make.bat

10 changes: 5 additions & 5 deletions sdk/gbz80-gb/2-1-5/examples/u3/battle2.c
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ void dostats(UBYTE which)
UBYTE currsel,nextptr ;
unsigned char *vidbase2 ;

if ( LCDC_REG&0x08 ) //select $9C00-$9FFF
if ( LCDC_REG&VIDEO_BUFFER_SECONDARY ) //select $9C00-$9FFF
vidbase2 = (unsigned char*)0x9800 ;
else
vidbase2 = (unsigned char*)0x9C00 ;
Expand Down Expand Up @@ -1021,9 +1021,9 @@ void dostats(UBYTE which)
enable_interrupts2() ;

if ( vidbase2==(unsigned char*)0x09800 )
LCDC_REG &= 0xF7 ; //select $9800-$9BFF
LCDC_REG &= VIDEO_BUFFER_PRIMARY ; //select $9800-$9BFF
else
LCDC_REG |= 0x08 ; //select $9C00-$9FFF
LCDC_REG |= VIDEO_BUFFER_SECONDARY ; //select $9C00-$9FFF

waitpadup() ;
while ( done==0 )
Expand Down Expand Up @@ -1207,15 +1207,15 @@ void dostats(UBYTE which)
VBK_REG=1 ;
set_data2(vidbase2,(unsigned char*)0x9C00,0x400) ;
VBK_REG=0 ;
LCDC_REG |= 0x08 ; //select $9C00-$9FFF
LCDC_REG |= VIDEO_BUFFER_SECONDARY ; //select $9C00-$9FFF
}
else
{
set_data2(vidbase2,(unsigned char*)0x9800,0x400) ;
VBK_REG=1 ;
set_data2(vidbase2,(unsigned char*)0x9800,0x400) ;
VBK_REG=0 ;
LCDC_REG &= 0xF7 ; //select $9800-$9BFF
LCDC_REG &= VIDEO_BUFFER_PRIMARY ; //select $9800-$9BFF
}

enable_interrupts2() ;
Expand Down
2 changes: 1 addition & 1 deletion sdk/gbz80-gb/2-1-5/examples/u3/cheat.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ UBYTE getmenuselection26(UBYTE numlines,unsigned char *menudata, void (*descptr)
UBYTE currline ;
UBYTE keys ;

if ( LCDC_REG&0x08 ) //select $9C00-$9FFF
if ( LCDC_REG&VIDEO_BUFFER_SECONDARY ) //select $9C00-$9FFF
vidbase = (unsigned char*)0x9C00 ;
else
vidbase = (unsigned char*)0x9800 ;
Expand Down
42 changes: 27 additions & 15 deletions sdk/gbz80-gb/2-1-5/examples/u3/demonfrm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1801,7 +1801,7 @@ void demon_animate()
VBK_REG=1 ;
set_bkg_data2( 0, 156U, demonframes[0] );

if ( LCDC_REG&0x08 )
if ( LCDC_REG&VIDEO_BUFFER_SECONDARY )
vidbase = (unsigned char*)0x9C00 ;
else
vidbase = (unsigned char*)0x9800 ;
Expand Down Expand Up @@ -1849,7 +1849,7 @@ void demon_animate()



if ( LCDC_REG&0x08 )
if ( LCDC_REG&VIDEO_BUFFER_SECONDARY )
{
vidbase = (unsigned char*)0x9800 ;
set_bkg_data2( 0, 156U, demonframes[dlcv] );
Expand Down Expand Up @@ -1911,17 +1911,23 @@ void demon_animate()
*/
VBK_REG = 0; // select palette bank

#ifdef ANALOGUE_POCKET
while ( LY_REG != 143U )
// while ( (LCDC_REG & 0x80) != 0x80 )
; //empty loop
#else
while ( LY_REG != 143U )
// while ( (LCDC_REG & 0x01) != 0x01 )
; //empty loop
#endif

set_bkg_palette( 0, 8, demonpals[dlcv] );


if ( LCDC_REG&0x08 )
LCDC_REG &= 0xF7 ; //select $9800-$9BFF
if ( LCDC_REG&VIDEO_BUFFER_SECONDARY )
LCDC_REG &= VIDEO_BUFFER_PRIMARY ; //select $9800-$9BFF
else
LCDC_REG |= 0x08 ; //select $9C00-$9FFF
LCDC_REG |= VIDEO_BUFFER_SECONDARY ; //select $9C00-$9FFF



Expand All @@ -1930,10 +1936,10 @@ void demon_animate()

//delay(10) ;
/*
if (LCDC_REG&0x08)
LCDC_REG &= 0xF7 ; //select $9800-$9BFF
if (LCDC_REG&VIDEO_BUFFER_SECONDARY)
LCDC_REG &= VIDEO_BUFFER_PRIMARY ; //select $9800-$9BFF
else
LCDC_REG |= 0x08 ; //select $9C00-$9FFF
LCDC_REG |= VIDEO_BUFFER_SECONDARY ; //select $9C00-$9FFF
*/
//enable_interrupts2() ;
// waitpad(J_START) ;
Expand All @@ -1952,7 +1958,7 @@ void demon_animate()



if ( LCDC_REG&0x08 )
if ( LCDC_REG&VIDEO_BUFFER_SECONDARY )
{
vidbase = (unsigned char*)0x9800 ;
set_bkg_data2( 0, 156U, demonframes[dlcv] );
Expand Down Expand Up @@ -1996,16 +2002,22 @@ void demon_animate()

VBK_REG = 0; // select palette bank

#ifdef ANALOGUE_POCKET
while ( LY_REG != 143U )
// while ( (LCDC_REG&0x80) != 0x80 )
; //empty loop
#else
while ( LY_REG != 143U )
// while ( (LCDC_REG&0x01) != 0x01 )
; //empty loop
#endif

set_bkg_palette( 0, 8, demonpals[dlcv] );

if ( LCDC_REG&0x08 )
LCDC_REG &= 0xF7 ; //select $9800-$9BFF
if ( LCDC_REG&VIDEO_BUFFER_SECONDARY )
LCDC_REG &= VIDEO_BUFFER_PRIMARY ; //select $9800-$9BFF
else
LCDC_REG |= 0x08 ; //select $9C00-$9FFF
LCDC_REG |= VIDEO_BUFFER_SECONDARY ; //select $9C00-$9FFF



Expand All @@ -2014,10 +2026,10 @@ void demon_animate()

//delay(10) ;
/*
if (LCDC_REG&0x08)
LCDC_REG &= 0xF7 ; //select $9800-$9BFF
if (LCDC_REG&VIDEO_BUFFER_SECONDARY)
LCDC_REG &= VIDEO_BUFFER_PRIMARY ; //select $9800-$9BFF
else
LCDC_REG |= 0x08 ; //select $9C00-$9FFF
LCDC_REG |= VIDEO_BUFFER_SECONDARY ; //select $9C00-$9FFF
*/
//enable_interrupts2() ;
// waitpad(J_START) ;
Expand Down
16 changes: 8 additions & 8 deletions sdk/gbz80-gb/2-1-5/examples/u3/dungfun2.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ UBYTE dopeergem2(UBYTE spell)

waitpadup() ;

if ( LCDC_REG&0x08 )
if ( LCDC_REG&VIDEO_BUFFER_SECONDARY )
{
vidbase = (unsigned char*)0x9800 ;
}
Expand Down Expand Up @@ -426,19 +426,19 @@ UBYTE dopeergem2(UBYTE spell)
}
for ( p=9; p<38 ; p++ )
move_sprite(p,0,0) ;
if ( LCDC_REG & 0x08 )
LCDC_REG &= 0xF7 ; //select $9800-$9BFF
if ( LCDC_REG & VIDEO_BUFFER_SECONDARY )
LCDC_REG &= VIDEO_BUFFER_PRIMARY ; //select $9800-$9BFF
else
LCDC_REG |= 0x08 ; //select $9C00-$9FFF
LCDC_REG |= VIDEO_BUFFER_SECONDARY ; //select $9C00-$9FFF


waitpad(0xFF) ;
waitpadup() ;

if ( LCDC_REG & 0x08 )
LCDC_REG &= 0xF7 ; //select $9800-$9BFF
if ( LCDC_REG & VIDEO_BUFFER_SECONDARY )
LCDC_REG &= VIDEO_BUFFER_PRIMARY ; //select $9800-$9BFF
else
LCDC_REG |= 0x08 ; //select $9C00-$9FFF
LCDC_REG |= VIDEO_BUFFER_SECONDARY ; //select $9C00-$9FFF

return 1 ;

Expand All @@ -451,7 +451,7 @@ UBYTE getmenuselection6(UBYTE numlines,unsigned char *menudata, void (*descptr)(
UBYTE currline ;
UBYTE keys ;

if ( LCDC_REG&0x08 ) //select $9C00-$9FFF
if ( LCDC_REG&VIDEO_BUFFER_SECONDARY ) //select $9C00-$9FFF
vidbase = (unsigned char*)0x9C00 ;
else
vidbase = (unsigned char*)0x9800 ;
Expand Down
26 changes: 13 additions & 13 deletions sdk/gbz80-gb/2-1-5/examples/u3/dungfunc.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ void update_screen_dungeon(UBYTE dofunctions)



if ( LCDC_REG&0x08 )
if ( LCDC_REG&VIDEO_BUFFER_SECONDARY )
{
vidbase = (unsigned char*)0x9800 ;
set_data2((unsigned char*)0x9800,(unsigned char*)0x9C00,0x400UL) ;
Expand Down Expand Up @@ -734,10 +734,10 @@ void update_screen_dungeon(UBYTE dofunctions)
{
writegamemessage(darkdat) ;
}
if ( LCDC_REG&0x08 )
LCDC_REG &= 0xF7 ; //select $9800-$9BFF
if ( LCDC_REG&VIDEO_BUFFER_SECONDARY )
LCDC_REG &= VIDEO_BUFFER_PRIMARY ; //select $9800-$9BFF
else
LCDC_REG |= 0x08 ; //select $9C00-$9FFF
LCDC_REG |= VIDEO_BUFFER_SECONDARY ; //select $9C00-$9FFF
return ;
}

Expand Down Expand Up @@ -1165,10 +1165,10 @@ void update_screen_dungeon(UBYTE dofunctions)
}
}

if ( LCDC_REG&0x08 )
LCDC_REG &= 0xF7 ; //select $9800-$9BFF
if ( LCDC_REG&VIDEO_BUFFER_SECONDARY )
LCDC_REG &= VIDEO_BUFFER_PRIMARY ; //select $9800-$9BFF
else
LCDC_REG |= 0x08 ; //select $9C00-$9FFF
LCDC_REG |= VIDEO_BUFFER_SECONDARY ; //select $9C00-$9FFF

if ( dofunctions != 0 )
{
Expand Down Expand Up @@ -1243,7 +1243,7 @@ void update_screen_dungeon(UBYTE dofunctions)
if ( currdungtile==2 ) //fountain
{
changemusic = 3 ;
if ( LCDC_REG&0x08 )
if ( LCDC_REG&VIDEO_BUFFER_SECONDARY )
set_data2((unsigned char*)0x9800,(unsigned char*)0x9C00,0x400L) ;
else
set_data2((unsigned char*)0x9C00,(unsigned char*)0x9800,0x400L) ;
Expand Down Expand Up @@ -1317,7 +1317,7 @@ void update_screen_dungeon(UBYTE dofunctions)
for ( r=0 ; r!=11 ; r++ )
set_bkg_tiles2(1,1+r,11,1,metile) ;
VBK_REG=0 ;
if ( LCDC_REG&0x08 )
if ( LCDC_REG&VIDEO_BUFFER_SECONDARY )
set_data2((unsigned char*)0x9C00,(unsigned char*)0x9800,12L*32L) ;
else
set_data2((unsigned char*)0x9800,(unsigned char*)0x9C00,12L*32L) ;
Expand All @@ -1329,7 +1329,7 @@ void update_screen_dungeon(UBYTE dofunctions)
if ( currdungtile==5 ) //mark
{
changemusic = 3 ;
if ( LCDC_REG&0x08 )
if ( LCDC_REG&VIDEO_BUFFER_SECONDARY )
set_data2((unsigned char*)0x9800,(unsigned char*)0x9C00,0x400L) ;
else
set_data2((unsigned char*)0x9C00,(unsigned char*)0x9800,0x400L) ;
Expand Down Expand Up @@ -1394,7 +1394,7 @@ void update_screen_dungeon(UBYTE dofunctions)
VBK_REG=1 ;
set_bkg_tiles2(6,6,1,1,metile) ;
VBK_REG=0 ;
if ( LCDC_REG&0x08 )
if ( LCDC_REG&VIDEO_BUFFER_SECONDARY )
set_data2((unsigned char*)0x9C00,(unsigned char*)0x9800,12L*32L) ;
else
set_data2((unsigned char*)0x9800,(unsigned char*)0x9C00,12L*32L) ;
Expand All @@ -1407,7 +1407,7 @@ void update_screen_dungeon(UBYTE dofunctions)
if ( currdungtile==1 ) //time lord
{
changemusic = 3 ;
if ( LCDC_REG&0x08 )
if ( LCDC_REG&VIDEO_BUFFER_SECONDARY )
set_data2((unsigned char*)0x9800,(unsigned char*)0x9C00,0x400L) ;
else
set_data2((unsigned char*)0x9C00,(unsigned char*)0x9800,0x400L) ;
Expand Down Expand Up @@ -1486,7 +1486,7 @@ void update_screen_dungeon(UBYTE dofunctions)
VBK_REG=0 ;


if ( LCDC_REG&0x08 )
if ( LCDC_REG&VIDEO_BUFFER_SECONDARY )
set_data2((unsigned char*)0x9C00,(unsigned char*)0x9800,12L*32L) ;
else
set_data2((unsigned char*)0x9800,(unsigned char*)0x9C00,12L*32L) ;
Expand Down
10 changes: 5 additions & 5 deletions sdk/gbz80-gb/2-1-5/examples/u3/explode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1720,7 +1720,7 @@ void shoot_animate1()
VBK_REG=1 ;
set_bkg_data2( 0, 100U, explodeframes[0] );

if ( LCDC_REG&0x08 )
if ( LCDC_REG&VIDEO_BUFFER_SECONDARY )
vidbase = (unsigned char*)0x9C00 ;
else
vidbase = (unsigned char*)0x9800 ;
Expand Down Expand Up @@ -1761,7 +1761,7 @@ void shoot_animate1()
for ( dlcv = 0 ; dlcv != 7 ; dlcv++ )
{

if ( LCDC_REG&0x08 )
if ( LCDC_REG&VIDEO_BUFFER_SECONDARY )
{
vidbase = (unsigned char*)0x9800 ;
set_bkg_data2( 0, 100U, explodeframes[dlcv] );
Expand Down Expand Up @@ -1814,10 +1814,10 @@ void shoot_animate1()
set_bkg_palette( 0, 8, explodepals[dlcv] );


if ( LCDC_REG&0x08 )
LCDC_REG &= 0xF7 ; //select $9800-$9BFF
if ( LCDC_REG&VIDEO_BUFFER_SECONDARY )
LCDC_REG &= VIDEO_BUFFER_PRIMARY ; //select $9800-$9BFF
else
LCDC_REG |= 0x08 ; //select $9C00-$9FFF
LCDC_REG |= VIDEO_BUFFER_SECONDARY ; //select $9C00-$9FFF



Expand Down
8 changes: 4 additions & 4 deletions sdk/gbz80-gb/2-1-5/examples/u3/explode2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1750,7 +1750,7 @@ void shoot_animate2()
for ( dlcv = 0 ; dlcv != 7 ; dlcv++ )
{

if ( LCDC_REG&0x08 )
if ( LCDC_REG&VIDEO_BUFFER_SECONDARY )
{
vidbase = (unsigned char*)0x9800 ;
set_bkg_data2( 0, 100U, explodeframes2[dlcv] );
Expand Down Expand Up @@ -1800,10 +1800,10 @@ void shoot_animate2()
set_bkg_palette( 0, 8, explodepals2[dlcv] );


if ( LCDC_REG&0x08 )
LCDC_REG &= 0xF7 ; //select $9800-$9BFF
if ( LCDC_REG&VIDEO_BUFFER_SECONDARY )
LCDC_REG &= VIDEO_BUFFER_PRIMARY ; //select $9800-$9BFF
else
LCDC_REG |= 0x08 ; //select $9C00-$9FFF
LCDC_REG |= VIDEO_BUFFER_SECONDARY ; //select $9C00-$9FFF



Expand Down
8 changes: 4 additions & 4 deletions sdk/gbz80-gb/2-1-5/examples/u3/explode3.c
Original file line number Diff line number Diff line change
Expand Up @@ -1728,7 +1728,7 @@ void shoot_animate3()
for ( dlcv = 0 ; dlcv != 7 ; dlcv++ )
{

if ( LCDC_REG&0x08 )
if ( LCDC_REG&VIDEO_BUFFER_SECONDARY )
{
vidbase = (unsigned char*)0x9800 ;
set_bkg_data2( 0, 100U, explodeframes3[dlcv] );
Expand Down Expand Up @@ -1778,10 +1778,10 @@ void shoot_animate3()
set_bkg_palette( 0, 8, explodepals3[dlcv] );


if ( LCDC_REG&0x08 )
LCDC_REG &= 0xF7 ; //select $9800-$9BFF
if ( LCDC_REG&VIDEO_BUFFER_SECONDARY )
LCDC_REG &= VIDEO_BUFFER_PRIMARY ; //select $9800-$9BFF
else
LCDC_REG |= 0x08 ; //select $9C00-$9FFF
LCDC_REG |= VIDEO_BUFFER_SECONDARY ; //select $9C00-$9FFF



Expand Down
Loading