Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #150 from PainsPerdus/display
Display
- Loading branch information
Showing
8 changed files
with
355 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
gameOverScreenInit: | ||
|
||
; ////// Copy Tiles \\\\\\ | ||
|
||
ld bc,_sizeof_GameOverTiles | ||
ld de,GameOverTiles | ||
ld hl,$8000 ;Block 0 start | ||
@loopTiles: ; while bc != 0 | ||
ld a,(de) | ||
ldi (hl),a | ||
inc de | ||
dec bc | ||
ld a,b | ||
or c | ||
jr nz,@loopTiles ; end while | ||
; \\\\\\ Copy Background Tiles ////// | ||
|
||
; /////// CLEAR BG \\\\\\\ | ||
ld de,32*32 | ||
ld hl,$9800 | ||
@clmap: ; while de != 0 | ||
ld a,220; | ||
ldi (hl),a ; *hl <- 220; hl++ | ||
dec de ; de -- | ||
ld a,e | ||
or d | ||
jr nz,@clmap ; end while | ||
; The Z flag can't be used when dec on 16bit reg :( | ||
; \\\\\\\ CLEAR BG /////// | ||
|
||
; /////// COPY BACKGROUND MAP \\\\\\\\ | ||
|
||
;We need to copy the data (20*18) array, to the first top left bytes of the background map (32*32 array) | ||
ld d,20 ;first loop counter | ||
ld e,_sizeof_GameOverMap/20 ;second loop counter | ||
ld bc,GameOverMap ;data to copy | ||
ld hl,$9800 ;Background Map 1 (to copy to) | ||
@map: | ||
ld a,(bc) | ||
ldi (hl),a ;copy data | ||
inc bc ;setup next byte to copy | ||
dec d | ||
jr nz,@map ;first loop on columns | ||
ld a,e ;save e | ||
ld de, 12 | ||
add hl, de ;jump to next bg line | ||
ld e,a ;restore e | ||
ld d,20 ;reset d | ||
dec e | ||
jr nz, @map; second loop on rows | ||
|
||
; \\\\\\\ COPY BACKGROUND MAP //////// | ||
|
||
; /////// CLEAR OAM \\\\\\\ | ||
ld hl,$FE00 | ||
ld b,40*4 | ||
@clspr: ; while b != 0 | ||
ld (hl),$00 ; *hl <- O | ||
inc l ; hl ++ (no ldi hl or inc hl: bug hardware!) | ||
dec b ; b -- | ||
jr nz,@clspr ; end while | ||
; set the background offset to 0 | ||
xor a | ||
ldh ($42),a | ||
ldh ($43),a | ||
; \\\\\\\ CLEAR OAM /////// | ||
|
||
; /////// INIT COLOR PALETTES \\\\\\\ | ||
ld a,%11100100 ; 11=Black 10=Dark Grey 01=Grey 00=White/trspt | ||
ldh ($47),a ; background palette | ||
ldh ($48),a ; sprite 0 palette | ||
ldh ($49),a ; sprite 1 palette | ||
; \\\\\\\ INIT COLOR PALETTES /////// | ||
|
||
; /////// ENABLE SCREEN \\\\\\\ | ||
ld a,%10010001 ; screen on, bg on, tiles at $8000 | ||
ldh ($40),a | ||
; \\\\\\\ ENABLE SCREEN /////// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.DB 218,218,218,218,000,001,002,003,004,005,006,007,008,009,218,218,218,218,218,218 | ||
.DB 218,218,218,218,010,011,012,013,014,015,016,017,018,019,020,021,022,023,218,218 | ||
.DB 218,218,218,218,024,025,026,027,028,029,030,031,032,033,034,035,036,037,218,218 | ||
.DB 218,218,218,038,039,040,041,042,043,219,219,044,045,046,047,048,049,050,218,218 | ||
.DB 218,218,218,051,219,219,052,053,054,055,056,219,219,057,058,059,060,061,218,218 | ||
|
||
.DB 218,218,218,062,063,064,065,066,219,219,067,068,069,219,071,072,073,074,218,218 | ||
.DB 218,218,218,075,076,077,078,079,080,081,082,219,083,219,084,085,086,087,218,218 | ||
.DB 218,218,088,089,090,091,092,093,094,095,096,097,098,099,100,101,102,218,218,218 | ||
.DB 218,218,103,104,105,106,107,108,109,110,111,219,112,113,114,115,116,218,218,218 | ||
.DB 218,218,117,118,119,120,121,219,122,123,124,125,126,127,219,219,128,218,218,218 | ||
.DB 218,218,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,218,218,218 | ||
.DB 218,145,146,147,148,149,150,151,219,152,153,154,219,219,219,219,155,218,218,218 | ||
.DB 218,156,157,219,158,159,160,161,162,219,163,219,219,219,219,164,165,218,218,218 | ||
.DB 218,166,219,219,219,219,167,168,169,170,171,172,173,174,175,176,218,218,218,218 | ||
.DB 218,177,219,219,219,178,179,180,181,182,183,184,185,186,187,188,218,218,218,218 | ||
.DB 218,189,190,191,192,193,194,195,196,197,198,199,219,219,219,200,218,218,218,218 | ||
.DB 218,218,218,218,201,202,203,204,205,206,207,208,219,219,219,209,218,218,218,218 | ||
.DB 218,218,218,218,218,218,218,218,218,218,218,210,211,212,213,214,218,218,218,218 | ||
|
||
|
Oops, something went wrong.