From 51d5e15eae77a3a578d650b74253a9484bacc677 Mon Sep 17 00:00:00 2001 From: Daniel Borges Date: Thu, 3 Jan 2019 23:43:16 +0100 Subject: [PATCH] separated background and sprite tiles, check only lines left in wait for render routine, added build files, rom, git ignore --- .gitignore | 2 ++ Code/data.asm | 14 ++++++++++---- Code/main.asm | 11 ++++++++--- Code/render.asm | 4 +--- Graphics/{Tiles.bin => BackgroundTiles.bin} | Bin 272 -> 272 bytes Graphics/BackgroundTiles.gbr | Bin 0 -> 10069 bytes Graphics/SpriteTiles.bin | Bin 0 -> 16 bytes Graphics/SpriteTiles.gbr | Bin 0 -> 10069 bytes Graphics/font.chr | Bin 2048 -> 0 bytes build.bat | 7 +++++++ rom.gb | Bin 0 -> 32768 bytes 11 files changed, 28 insertions(+), 10 deletions(-) create mode 100644 .gitignore rename Graphics/{Tiles.bin => BackgroundTiles.bin} (94%) create mode 100644 Graphics/BackgroundTiles.gbr create mode 100644 Graphics/SpriteTiles.bin create mode 100644 Graphics/SpriteTiles.gbr delete mode 100644 Graphics/font.chr create mode 100644 build.bat create mode 100644 rom.gb diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6b0ad9c --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +Build +rom.sym \ No newline at end of file diff --git a/Code/data.asm b/Code/data.asm index 56d3917..441f6da 100644 --- a/Code/data.asm +++ b/Code/data.asm @@ -43,8 +43,14 @@ DefaultMap: db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -EXPORT Tiles, TilesEnd +EXPORT BackgroundTiles, BackgroundTilesEnd SECTION "Graphics", ROM0 -Tiles: -INCBIN "Tiles.bin" -TilesEnd: ds 0 \ No newline at end of file +BackgroundTiles: +INCBIN "BackgroundTiles.bin" +BackgroundTilesEnd: ds 0 + +EXPORT SpriteTiles, SpriteTilesEnd +SECTION "Graphics", ROM0 +SpriteTiles: +INCBIN "SpriteTiles.bin" +SpriteTilesEnd: ds 0 \ No newline at end of file diff --git a/Code/main.asm b/Code/main.asm index 189efac..4f38de2 100644 --- a/Code/main.asm +++ b/Code/main.asm @@ -40,10 +40,15 @@ Start: ; 16: sprite selection tile ; 17: empty tile ld hl, _VRAM_BG_TILES - ld de, Tiles - ld bc, TilesEnd - Tiles + ld de, BackgroundTiles + ld bc, BackgroundTilesEnd - BackgroundTiles call MemoryCopy - + + ld hl, _VRAM + ld de, SpriteTiles + ld bc, SpriteTilesEnd - SpriteTiles + call MemoryCopy + ; clear OAM ld hl, _OAMRAM ld d, 0 diff --git a/Code/render.asm b/Code/render.asm index ed150a3..790972b 100644 --- a/Code/render.asm +++ b/Code/render.asm @@ -136,9 +136,7 @@ EXPORT WaitRender SECTION "WaitRender", ROM0 WaitRender: ldh a, [LinesLeft] - ld b, a - ldh a, [TilesLeft] - or a, b + or a ret z halt jr WaitRender diff --git a/Graphics/Tiles.bin b/Graphics/BackgroundTiles.bin similarity index 94% rename from Graphics/Tiles.bin rename to Graphics/BackgroundTiles.bin index c3e9a0b72f6bafdcf30f2a7de4d3cdec1aa28dd2..4c0e1757f3ef58b2e6017c1a13cb862c97b386a1 100644 GIT binary patch delta 23 RcmbQhG=XUWqW}XM001T}0oDKj delta 23 ZcmbQhG=XUWqrip>4FUoU7d9|J0RUOO1@-^{ diff --git a/Graphics/BackgroundTiles.gbr b/Graphics/BackgroundTiles.gbr new file mode 100644 index 0000000000000000000000000000000000000000..4a8c2e5be08a7717d439c6d467dbb288d18cae9a GIT binary patch literal 10069 zcmeHN%}&BV5T3TET;!q;(4$@|dJ>PQ!Gj4N^wvu$i&UT`Ed=#od;_1yvoGQs_z1eQ z?KBIaRAZtEnGM_7e)G-W*WPHW*{&M^a4&bu8;MTzU|$DAVV{X4xD7=t@pK(IN3dg> z^5!BMi4%J^n>oIhh>_=nVsh}*ACIQPt`P0zz>8Bhr z=Ufd9SH~iK%jPfZACu#vnaHMSdev$mPxYzCV0ck~8gGt6I9bX|mTs= z=h1kD^)=31oQ6|gvN=!oqi99*qd)7JVyO?6W1$9d)1+xEVN2u7@|XElA-=EztN<&( z3a|pK04u->umY?AE5Hh{0;~WlzzVPetN<&(3a|pK04u->umY^WIw)X)2|IES{HGCr z@&cb~K?N*$Q?B#-aTHIS$K(1xjf`JWBn!0>yYxC@sN>lFlC>d+d6BpQrzh@BBI3k7 z^TI$3UHNIoU=oep?0XIODvs`iKS>nO?p+2w;kIIL+zITHjbuYS2g5xf^bQ( zm5^$1H>H@{umPJ&_A0!8>_g+V3HJ05wi?c#-&cNJapm0KaMoZGY88A)&);A(Wt|n^ MH(;Hg?oVd>0`}Z~egFUf literal 0 HcmV?d00001 diff --git a/Graphics/SpriteTiles.bin b/Graphics/SpriteTiles.bin new file mode 100644 index 0000000000000000000000000000000000000000..43d4178914bddf57e97c21226a045793689e7251 GIT binary patch literal 16 Scmdn6VZwxlhJpeHC;$LBU<6?R literal 0 HcmV?d00001 diff --git a/Graphics/SpriteTiles.gbr b/Graphics/SpriteTiles.gbr new file mode 100644 index 0000000000000000000000000000000000000000..fe6258a3ea21acc81fac96608f04dbf312680827 GIT binary patch literal 10069 zcmeI&F;2rU6b9fwaay|2g$r0>fyF?#GF25)8ITy@0tr|UDM_oQRbYYMfb%eO5jX)y zfaiot6)NfwsHpT?i7mh6#m<+EZ_qzK^Z?w+IS5l54e#}3oLGHg^Y|vSV~JO-V>;;J zZMTQhVQPrP3Q&Lo6rcbFC_n)UP=Epypa2CZK!N`(px|Ri zHYjxqo|4|xFMN~@fm8&%l$S0><9K3SDMN0eI9vPs1m)7-mUXeSFtW*F+--kJYskwy zN&JV)OEUg6^!WAkZ8Xqy@=}iR`o53ub02zogsrYw`#h+|N~}+-+N=?~@h2FS=0_KM_SlQRF=V86J+uBsm^sN4P?3 zj9>+7MOliZwXED+u7Kou@E*r$iu{x+ifO~?q!i@KWm#ZNDQk(UYMP=5w#Sj>whe+L z34*q*Dr8d>eQ#~Ffyml%MO6jCG=azdaWn=lAX^)(fHFKV4@P)iX)XJSU{6NGFEYpP zc~MlBbzPRI9C-NP2Ww$i%jFZtM0hY>E@lHHrLwG9VJ$`?V=&7|bU45-kfw(N(Xw2x z&}f?Lby?sSoQ!|UsJGVO9}nz6Jur(m_~Xu^yXZ2l-EuGn`qyjMy}iwI*R?J3b3oor zGfnsVW^^4Oe|!wX?bfz8yXx4{x&! z{TBXypC*ov8Lm3fuMPV>R{-^M=N0)S$@99zNrH}{6LB1dzVCTNyPd1oZim~m-$UzX ze149jyEUSN?6l_ixh`A<^b6n~*0t*ov{@fKYHSSid}6FkH-KecYtKVJVV|wT0$5a$ zv*#P`k%@V9#cbvh4l6>v&D%`$6#X5(NJC2lx#%May0Q diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..f965f40 --- /dev/null +++ b/build.bat @@ -0,0 +1,7 @@ +..\..\Assembler\rgbasm -i ..\..\Include\ -i Graphics\ -i Code\ -o Build\main.o Code\main.asm +..\..\Assembler\rgbasm -i ..\..\Include\ -i Graphics\ -i Code\ -o Build\data.o Code\data.asm +..\..\Assembler\rgbasm -i ..\..\Include\ -i Graphics\ -i Code\ -o Build\automata.o Code\automata.asm +..\..\Assembler\rgbasm -i ..\..\Include\ -i Graphics\ -i Code\ -o Build\render.o Code\render.asm +..\..\Assembler\rgbasm -i ..\..\Include\ -i Graphics\ -i Code\ -o Build\utils.o Code\utils.asm +..\..\Assembler\rgblink -n rom.sym -w -t -o rom.gb -d Build/main.o Build/data.o Build/automata.o Build/render.o Build/utils.o +..\..\Assembler\rgbfix -t "Game of Life" -v -p 0 rom.gb \ No newline at end of file diff --git a/rom.gb b/rom.gb new file mode 100644 index 0000000000000000000000000000000000000000..40b908d4c29efcfa53bbb78a6e735d68c1283661 GIT binary patch literal 32768 zcmeI#&1)M+7zf~))kkDoQY=R`CKReozZ~ach_6}X^q@<@g|_L@E+wm$(8y2-NgN5u zcKnf($ti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