diff --git a/BootROMs/sgb_boot.asm b/BootROMs/sgb_boot.asm index eaa93e568..bc7c87bff 100644 --- a/BootROMs/sgb_boot.asm +++ b/BootROMs/sgb_boot.asm @@ -119,6 +119,19 @@ Start: ld a, $30 ld [c], a + ; Wait 4 frames + ld e, 4 + ld a, 1 + ldh [rIE], a + xor a +.waitLoop + ldh [rIF], a + halt + nop + dec e + jr nz, .waitLoop + ldh [rIE], a + ; Update command ldh a, [_HRAM] add 2 @@ -198,16 +211,6 @@ DoubleBitsAndWriteRow: inc hl ret -WaitFrame: - push hl - ld hl, $FF0F - res 0, [hl] -.wait - bit 0, [hl] - jr z, .wait - pop hl - ret - TrademarkSymbol: db $3c,$42,$b9,$a5,$b9,$a5,$42,$3c diff --git a/Makefile b/Makefile index 5754ef205..c130cf295 100644 --- a/Makefile +++ b/Makefile @@ -629,7 +629,7 @@ $(BIN)/BootROMs/sgb2_boot: BootROMs/sgb_boot.asm $(BIN)/BootROMs/%.bin: BootROMs/%.asm $(OBJ)/BootROMs/SameBoyLogo.pb12 -@$(MKDIR) -p $(dir $@) - $(RGBASM) -i $(OBJ)/BootROMs/ -i BootROMs/ -o $@.tmp $< + $(RGBASM) -H -i $(OBJ)/BootROMs/ -i BootROMs/ -o $@.tmp $< $(RGBLINK) -o $@.tmp2 $@.tmp dd if=$@.tmp2 of=$@ count=1 bs=$(if $(findstring cgb,$@)$(findstring agb,$@),2304,256) 2> $(NULL) @rm $@.tmp $@.tmp2