TheEmperor: db 10, "THE " db 10, "EMPEROR " db 9, "authority" db 9, "control " db 9, "stability" dw EmperorMapEnd - EmperorMap dw EmperorMap dw EmperorTilesEnd - EmperorTiles dw EmperorTiles dw .SpriteTilesEnd - .SpriteTiles dw .SpriteTiles dw .fInit dw .fUpdate dw .fDraw .fInit: ld hl, CVS ld a, 0 ld [hl+], a ; CVS timer for smoke ld [hl+], a ld [hl+], a ; CVS+2 frame of animation ld hl, MY_OAM+3 ; attributes ld bc, 4 ld d, 30 .priorityLoop set OAMB_PRI, [hl] add hl, bc dec d jp nz, .priorityLoop ; set the priority bt for all sprites ld hl, .flash ld de, MY_OAM+2*4 ld b, 160 ld c, 0 ld a, $22 call BuildMetaSprite ld hl, .flash ld de, MY_OAM+6*4 ld b, 160 ld c, 0 ld a, $22 call BuildMetaSprite ld hl, .flash ld de, MY_OAM+10*4 ld b, 160 ld c, 0 ld a, $22 call BuildMetaSprite ld hl, .flash ld de, MY_OAM+14*4 ld b, 160 ld c, 0 ld a, $22 call BuildMetaSprite ret ; oam 0-1 gorget ; oam 2-5 gauntlet left ; oam 6-9 foot left ; oam 10-13 gauntlet right ; oam 14-17 foot right .fUpdate: ld hl, CVS call IncrementTimer ld a, [CVS+1] ; checking the high byte of the timer cp a, $30 ; $10 = 1 second, $02 = 1/8 of a second jp c, .doneWithTimer1 ; reset timer ld a, 0 ld [CVS], a ld [CVS+1], a ld a, 1 ld [CVS+2], a .doneWithTimer1 ld a, [CVS+2] cp a, 0 call nz, .animate ret .animate: ld b, 50 ; length of animation ld a, [CVS+2] inc a call ArrayClampLoopingB ld [CVS+2], a ; gorget flash ld a, [CVS+2] sub a, 24 jp c, .doneWithGorget ; a < 24 ----> skip gorget cp a, 6 jp nc, .doneWithGorget ; a >= 6 ---> skip gorget add a, a ; double to make an offset into gorgetsheen ld b, 0 ld c, a ld hl, .gorgetSheen add hl, bc ; sprites ld de, MY_OAM ld b, 8*6 ld c, 8*5 ld a, $12 call BuildMetaSprite .doneWithGorget ; stage-left foot animation ld a, [CVS+2] sub a, 2 jp c, .doneWithLeftFoot ; a < 2 -----> skip left foot jp z, .startLeftFoot ; a == 2 -------> start left foot cp a, 8 jp nc, .killLeftFoot ; after 8-1 frames, kill the left foot ld hl, MY_OAM + 2*4 dec [hl] inc hl inc [hl] inc [hl] ld hl, MY_OAM + 3*4 dec [hl] inc hl inc [hl] inc [hl] ld hl, MY_OAM + 4*4 dec [hl] inc hl inc [hl] inc [hl] ld hl, MY_OAM + 5*4 dec [hl] inc hl inc [hl] inc [hl] jp .doneWithLeftFoot .killLeftFoot ld hl, MY_OAM + 2*4 ld [hl], 160 ld hl, MY_OAM + 3*4 ld [hl], 160 ld hl, MY_OAM + 4*4 ld [hl], 160 ld hl, MY_OAM + 5*4 ld [hl], 160 jp .doneWithLeftFoot .startLeftFoot ld hl, .flash ld de, MY_OAM + 2*4 ld b, 104+16 ld c, 8+8 ld a, $22 call BuildMetaSprite .doneWithLeftFoot ; stage-right foot animation ld a, [CVS+2] cp a, 20 jp nc, .killRightFoot cp a, 11 jp c, .doneWithRightFoot jp z, .startRightFoot jp .continueRightFoot .startRightFoot ld hl, .flash ld de, MY_OAM+6*4 ld b, 104+16 ld c, 40+8 ld a, $22 call BuildMetaSprite jp .doneWithRightFoot .continueRightFoot ld hl, MY_OAM + 6*4 dec [hl] inc hl inc [hl] inc [hl] ld hl, MY_OAM + 7*4 dec [hl] inc hl inc [hl] inc [hl] ld hl, MY_OAM + 8*4 dec [hl] inc hl inc [hl] inc [hl] ld hl, MY_OAM + 9*4 dec [hl] inc hl inc [hl] inc [hl] jp .doneWithRightFoot .killRightFoot ld hl, MY_OAM+6*4 ld [hl], 160 ld hl, MY_OAM+7*4 ld [hl], 160 ld hl, MY_OAM+8*4 ld [hl], 160 ld hl, MY_OAM+9*4 ld [hl], 160 jp .doneWithRightFoot .doneWithRightFoot ; stage-left hand animation ld a, [CVS+2] sub a, 11 jp c, .doneWithLeftHand cp a, 7+1 jp nc, .doneWithLeftHand add a, a ; double add a, a ; double again to make an offset into lefthandsheen ld b, 0 ld c, a ld hl, .leftHandSheen add hl, bc ; sprites ld de, MY_OAM+10*4 ld b, 8*10 ld c, 8*2 ld a, $22 call BuildMetaSprite .doneWithLeftHand ; right hand ld a, [CVS+2] sub a, 19 jp z, .startRightHand jp c, .doneWithRightHand cp a, 20 jp nc, .killRightHand ld hl, MY_OAM + 14*4 dec [hl] dec [hl] dec [hl] ;dec [hl] ld hl, MY_OAM + 15*4 dec [hl] dec [hl] dec [hl] ;dec [hl] ld hl, MY_OAM + 16*4 dec [hl] dec [hl] dec [hl] ;dec [hl] ld hl, MY_OAM + 17*4 dec [hl] dec [hl] dec [hl] ;dec [hl] jp .doneWithRightHand .killRightHand ld hl, MY_OAM+14*4 ld [hl], 160 ld hl, MY_OAM+15*4 ld [hl], 160 ld hl, MY_OAM+16*4 ld [hl], 160 ld hl, MY_OAM+17*4 ld [hl], 160 jp .doneWithRightHand .startRightHand ld hl, .flash ld de, MY_OAM+14*4 ld b, 107+16 ld c, 62+8 ld a, $22 call BuildMetaSprite .doneWithRightHand ret .flash: db $13, $00 db $01, $13 .gorgetSheen: db $08, $00 db $07, $00 db $05, $06 db $03, $04 db $00, $02 db $00, $00 .leftHandSheen: db $00, $00 db $17, $00 db $14, $00 db $15, $16 db $14, $00 db $15, $16 db $0b, $0d db $0c, $0a db $0f, $0e db $00, $00 db $11, $10 db $00, $00 db $00, $12 db $00, $00 db $00, $00 db $00, $00 .fDraw: ret .SpriteTiles: db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 db $03,$00,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 db $00,$00,$40,$00,$38,$00,$1c,$00,$08,$00,$00,$00,$00,$00,$00,$00 db $00,$00,$00,$00,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 db $00,$00,$80,$00,$c0,$00,$e0,$00,$70,$00,$38,$00,$00,$00,$00,$00 db $00,$00,$18,$00,$0e,$00,$07,$00,$03,$00,$01,$00,$00,$00,$00,$00 db $00,$00,$00,$00,$00,$00,$00,$00,$80,$00,$c0,$00,$20,$00,$00,$00 db $00,$00,$00,$00,$70,$00,$38,$00,$1c,$00,$0e,$00,$06,$00,$00,$00 db $00,$00,$00,$00,$80,$00,$c0,$00,$e0,$00,$70,$00,$00,$00,$00,$00 db $00,$00,$00,$00,$04,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 db $c0,$00,$e0,$00,$60,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 db $00,$00,$00,$00,$00,$00,$00,$00,$04,$00,$06,$00,$07,$00,$03,$00 db $01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$80,$00 db $00,$00,$00,$00,$00,$00,$00,$00,$80,$00,$c0,$00,$c0,$00,$40,$00 db $00,$00,$00,$00,$00,$00,$03,$00,$03,$00,$01,$00,$00,$00,$00,$00 db $00,$00,$80,$00,$c0,$00,$e0,$00,$70,$00,$38,$00,$04,$00,$04,$00 db $00,$00,$01,$00,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 db $00,$00,$40,$00,$38,$00,$1c,$00,$0c,$00,$04,$00,$00,$00,$00,$00 db $80,$00,$c0,$00,$e0,$00,$70,$00,$38,$00,$1c,$00,$0e,$00,$07,$00 db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$08,$00,$0c,$00 db $0e,$00,$07,$00,$03,$00,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00 db $00,$00,$00,$00,$80,$00,$c0,$00,$c0,$00,$00,$00,$00,$00,$00,$00 db $00,$00,$08,$00,$0c,$00,$06,$00,$07,$00,$00,$00,$00,$00,$00,$00 .SpriteTilesEnd: EmperorMap: db $1b, $1c, $1d, $1e, $1f, $20, $21, $62 db $22, $23, $24, $25, $26, $63, $64, $65 db $28, $29, $2a, $2b, $2c, $6d, $66, $4d db $6e, $2d, $2e, $2f, $30, $31, $27, $6e db $6f, $32, $74, $1a, $1a, $76, $33, $6f db $70, $34, $6a, $75, $72, $35, $36, $70 db $37, $38, $6b, $77, $73, $39, $3a, $69 db $3b, $3c, $3d, $77, $77, $3e, $3f, $40 db $41, $42, $43, $77, $44, $45, $46, $47 db $6c, $48, $49, $4a, $4b, $77, $4c, $79 db $6c, $4e, $77, $77, $77, $4f, $50, $79 db $6c, $51, $52, $53, $54, $55, $56, $79 db $67, $57, $58, $59, $5a, $5b, $5c, $68 db $5d, $5e, $5f, $71, $71, $60, $61, $78 db $71, $71, $71, $7b, $7c, $71, $71, $71 db $71, $71, $71, $7a, $7d, $71, $71, $71 EmperorMapEnd: EmperorTiles: db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 db $7f,$ff,$ff,$ff,$fe,$ff,$fc,$ff,$74,$fe,$fc,$fe,$fc,$fe,$fc,$fe db $7f,$ff,$ff,$ff,$00,$ff,$00,$08,$00,$08,$00,$0b,$00,$0e,$00,$7f db $ff,$ff,$ff,$ff,$1f,$ff,$0f,$3f,$07,$1f,$0f,$1f,$0f,$9f,$00,$9f db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$77,$ff,$e0,$ff,$80,$ff,$00,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$f7,$ff,$3f,$ff,$1f,$ff,$00,$ff db $ff,$ff,$ff,$ff,$f8,$ff,$f0,$fc,$f0,$f8,$f0,$f8,$f0,$f9,$00,$ff db $ff,$ff,$ff,$ff,$00,$ff,$00,$10,$00,$10,$00,$d0,$00,$70,$00,$fe db $74,$fe,$fc,$fe,$dc,$ff,$fe,$ff,$54,$ff,$fc,$ff,$dc,$fe,$fc,$ff db $00,$30,$00,$2f,$00,$10,$00,$1f,$07,$18,$0f,$10,$0f,$30,$0f,$70 db $0e,$91,$0e,$b1,$1e,$21,$3c,$c3,$fc,$03,$fc,$03,$fc,$03,$fc,$03 db $00,$ff,$00,$ff,$00,$f8,$00,$f0,$00,$e0,$18,$98,$08,$98,$00,$82 db $0f,$f0,$07,$f8,$03,$fc,$03,$7c,$03,$3c,$c1,$de,$81,$ce,$01,$0e db $f5,$0f,$f3,$0f,$f5,$0f,$f7,$0f,$f5,$0f,$f3,$0f,$f5,$0f,$f6,$0f db $54,$ff,$ff,$ff,$55,$ff,$ff,$ff,$55,$ff,$bb,$ff,$55,$ff,$ff,$ff db $0f,$f0,$ef,$f0,$4f,$f0,$ef,$f0,$4f,$f0,$ef,$f0,$4f,$f0,$ef,$f0 db $fc,$03,$fc,$03,$fc,$03,$fd,$03,$ff,$03,$ff,$02,$ff,$00,$ff,$00 db $40,$83,$40,$80,$b0,$c7,$80,$ff,$80,$70,$80,$7f,$c0,$7f,$e0,$7f db $10,$0f,$11,$0e,$39,$0e,$09,$fe,$0d,$76,$0e,$f3,$0e,$f1,$7f,$f0 db $4f,$f0,$af,$f0,$4f,$f0,$ef,$f0,$4f,$f0,$af,$f1,$4f,$f3,$ef,$f7 db $ff,$00,$ff,$01,$ff,$0f,$ff,$3f,$f1,$71,$c0,$c0,$80,$80,$00,$00 db $fd,$3f,$e7,$e7,$20,$20,$1f,$1f,$00,$00,$80,$80,$f9,$f9,$0f,$0f db $ff,$e0,$3f,$3e,$23,$23,$c3,$c3,$06,$06,$0c,$0c,$f8,$f8,$00,$00 db $ff,$00,$ff,$00,$ff,$80,$ff,$f0,$3f,$3c,$0f,$0c,$07,$06,$03,$03 db $4e,$f6,$ae,$f6,$4e,$f6,$ae,$f6,$4e,$f6,$ae,$f6,$4f,$f7,$af,$f7 db $f5,$8f,$f2,$8f,$f5,$cf,$76,$4f,$75,$6f,$32,$2f,$35,$2f,$32,$2f db $0f,$f2,$af,$f2,$4f,$f2,$af,$f2,$0f,$f2,$af,$f2,$4f,$f6,$ad,$fc db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$01,$01 db $35,$2f,$32,$2f,$35,$2f,$32,$2f,$71,$6f,$72,$6f,$f4,$cf,$f2,$cf db $00,$ff,$aa,$ff,$04,$ff,$aa,$ff,$00,$ff,$a9,$ff,$03,$ff,$a7,$fa db $0d,$f8,$95,$f0,$35,$e0,$55,$c0,$d5,$80,$55,$00,$55,$00,$54,$01 db $ff,$ff,$35,$f0,$35,$f0,$35,$f0,$35,$f0,$35,$f0,$35,$f8,$39,$7c db $71,$6f,$72,$3f,$5c,$1b,$56,$07,$57,$03,$55,$01,$55,$00,$55,$00 db $0f,$f3,$1e,$e2,$3e,$c6,$7c,$8c,$f8,$1f,$f8,$18,$f0,$30,$30,$f0 db $f4,$e3,$3d,$3b,$05,$07,$03,$0b,$02,$f3,$02,$13,$3a,$3b,$2a,$3b db $c1,$fc,$91,$fc,$11,$fc,$11,$fc,$15,$f8,$35,$f0,$35,$f0,$75,$e0 db $39,$7e,$1e,$7f,$17,$7f,$12,$7f,$49,$3f,$4c,$3f,$46,$1f,$53,$0f db $55,$00,$55,$00,$f5,$e1,$3d,$fd,$87,$ff,$41,$ff,$21,$ff,$19,$ff db $fd,$fd,$83,$8b,$01,$09,$01,$09,$01,$09,$01,$09,$01,$09,$81,$89 db $70,$bf,$70,$90,$70,$90,$78,$98,$78,$98,$7f,$8f,$7f,$80,$7f,$80 db $26,$ff,$11,$1f,$13,$1f,$33,$3e,$37,$3e,$ed,$fc,$ed,$18,$fd,$18 db $d5,$c0,$d5,$80,$55,$00,$55,$00,$55,$00,$55,$20,$45,$30,$41,$1c db $55,$00,$55,$00,$55,$00,$55,$00,$55,$00,$55,$00,$54,$01,$50,$07 db $51,$07,$54,$03,$54,$01,$54,$01,$55,$00,$00,$7f,$15,$c0,$55,$00 db $8f,$ff,$8f,$ff,$cf,$ff,$6f,$fa,$37,$f8,$1f,$f8,$1f,$f8,$1f,$78 db $c3,$cb,$fe,$ff,$fe,$ff,$9e,$95,$9e,$91,$9e,$91,$9e,$91,$9e,$91 db $f5,$10,$f5,$20,$f5,$20,$f5,$20,$f5,$20,$f5,$20,$f5,$20,$f5,$20 db $54,$03,$55,$00,$55,$00,$55,$00,$55,$00,$55,$00,$55,$00,$55,$00 db $15,$e0,$05,$f0,$45,$30,$40,$1f,$55,$00,$55,$00,$55,$00,$55,$00 db $51,$04,$55,$08,$05,$78,$15,$c0,$55,$00,$55,$00,$55,$00,$55,$00 db $4f,$38,$47,$1e,$57,$0e,$53,$06,$53,$06,$53,$06,$57,$06,$57,$04 db $55,$ff,$ff,$ff,$55,$ff,$ff,$ff,$55,$ff,$ef,$ff,$55,$ff,$ff,$ff db $f5,$20,$f5,$20,$f5,$60,$d5,$60,$d5,$60,$d5,$60,$d5,$60,$d5,$e0 db $55,$00,$55,$00,$55,$00,$55,$00,$55,$00,$55,$00,$54,$03,$50,$07 db $53,$0c,$5f,$08,$5f,$08,$57,$18,$5f,$10,$5f,$10,$7f,$30,$7f,$20 db $d5,$e0,$c0,$ff,$80,$ff,$80,$ff,$9f,$f0,$90,$f0,$90,$f0,$90,$f0 db $55,$00,$15,$c0,$15,$e0,$05,$f0,$c5,$38,$61,$1c,$31,$1e,$18,$1f db $55,$00,$55,$00,$55,$00,$55,$00,$55,$00,$55,$00,$55,$00,$55,$80 db $55,$00,$55,$00,$55,$00,$55,$00,$54,$01,$54,$03,$50,$0f,$40,$1f db $50,$0f,$40,$3f,$0c,$73,$1f,$e0,$71,$c1,$61,$c1,$e1,$c1,$c3,$c3 db $7f,$e0,$7f,$c0,$7f,$c0,$ff,$c0,$ff,$80,$ff,$00,$ff,$00,$ff,$00 db $d0,$70,$f0,$70,$f8,$38,$d8,$38,$df,$3f,$d9,$39,$d0,$30,$e0,$e0 db $30,$3f,$30,$3f,$20,$3f,$20,$3f,$70,$6f,$f8,$e7,$3e,$21,$3f,$3f db $15,$c0,$05,$f0,$01,$fe,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$c0,$ff db $40,$3f,$00,$7f,$00,$ff,$00,$ff,$01,$fe,$03,$fc,$0f,$f0,$7f,$ff db $c3,$c2,$c3,$c2,$c7,$c6,$c7,$ce,$e7,$fe,$ff,$ff,$80,$80,$80,$80 db $ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$80,$ff,$ff db $00,$ff,$00,$ff,$01,$ff,$03,$ff,$02,$fe,$06,$fe,$04,$fc,$07,$ff db $60,$e0,$c0,$c0,$80,$80,$00,$01,$00,$07,$07,$3f,$7c,$7f,$e0,$ff db $10,$1f,$10,$1f,$10,$ff,$30,$ff,$e0,$ff,$80,$ff,$00,$ff,$00,$ff db $80,$80,$80,$80,$80,$f0,$c0,$f0,$60,$f8,$30,$fc,$18,$ff,$0f,$ff db $60,$7f,$20,$7f,$30,$3f,$10,$3f,$18,$1f,$08,$1f,$0c,$8f,$fc,$ff db $ff,$ff,$ff,$ff,$7f,$ff,$3f,$ff,$37,$7f,$3f,$7f,$3f,$7f,$3f,$7f db $f0,$09,$f0,$0d,$f8,$04,$fc,$03,$ff,$00,$ff,$00,$ff,$00,$ff,$00 db $00,$0c,$00,$fc,$00,$08,$00,$f8,$e0,$18,$f0,$08,$f0,$0c,$f0,$0e db $37,$7f,$3f,$7f,$1d,$ff,$7f,$ff,$77,$ff,$3f,$ff,$1d,$7f,$3f,$ff db $f4,$0f,$f7,$0f,$f5,$0f,$f7,$0f,$f5,$0f,$f6,$0f,$f5,$0f,$f7,$0f db $7f,$80,$7f,$80,$7f,$80,$7f,$80,$7f,$80,$7f,$80,$7f,$80,$ff,$ff db $9e,$91,$9e,$91,$9e,$91,$9e,$91,$9e,$91,$9e,$91,$9e,$91,$9f,$9f db $01,$ff,$aa,$ff,$e4,$ff,$9a,$9f,$98,$9f,$fe,$ff,$94,$b7,$92,$93 db $c0,$c0,$70,$30,$58,$18,$5c,$0e,$57,$07,$55,$07,$54,$07,$54,$07 db $54,$0f,$45,$1e,$4d,$1e,$49,$3e,$19,$7e,$39,$7e,$21,$fe,$61,$fc db $7f,$80,$7f,$80,$7f,$80,$7f,$80,$7f,$80,$7f,$80,$7f,$80,$7f,$80 db $ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00 db $55,$ff,$bb,$ff,$55,$ff,$ee,$ff,$55,$ff,$ba,$ff,$55,$ff,$ee,$ff db $55,$ff,$aa,$ff,$55,$ff,$aa,$ff,$55,$ff,$aa,$ff,$55,$ff,$aa,$ff db $11,$ff,$aa,$ff,$45,$ff,$aa,$ff,$11,$ff,$aa,$ff,$44,$ff,$aa,$ff db $00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$80,$80,$f0,$f0 db $5f,$0f,$54,$01,$54,$01,$55,$00,$55,$00,$55,$00,$55,$00,$55,$00 db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$80,$80 db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$f8,$f8,$57,$07,$55,$00 db $01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 db $55,$00,$55,$00,$55,$00,$55,$00,$55,$00,$55,$00,$55,$00,$55,$00 db $b0,$bf,$e0,$ff,$c0,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff db $9e,$91,$9e,$91,$9e,$91,$9e,$91,$9e,$91,$9e,$91,$9e,$91,$9e,$91 db $00,$e6,$00,$e7,$00,$e7,$00,$e7,$00,$80,$00,$ff,$00,$ff,$00,$ff db $00,$ff,$00,$ff,$00,$ff,$00,$80,$00,$e5,$00,$e4,$00,$e6,$00,$e6 db $00,$ff,$00,$ff,$00,$ff,$00,$01,$00,$f7,$00,$e7,$00,$ef,$00,$ef db $00,$4f,$00,$5f,$00,$1f,$00,$bf,$00,$07,$00,$ff,$00,$ff,$00,$ff EmperorTilesEnd: