INT scale x =2, scale y =1 ĬHAR black = "#", white = ".", clear = " " Works with: ALGOL 68G version Any - tested with release 1.18.0-9h.tiny. Pragma Assert (Status = Cairo_Status_Success ) Status := Write_To_Png (Surface, "YinYangAda.png" )
Procedure Draw (C : Cairo_Context x : Dub y : Dub r : Dub ) is begin YinYang_Tile: EACH NUMBER REPRESENTS A TILE IN THE CHARACTER ROM BACKUP D3, IT WILL GET RESTORED AT THE OUTER LOOPĭBRA D3,loop_tile_OAM NEXT TILE IN STRIPĭBRA D2,loop_sprite_OAM REPEAT UNTIL ALL SPRITES FINISHED. LEA YinYang_Pal, A1 LOAD ADDRESS OF SOURCE DATA LEA YinYang_Tile, A0 LOAD ADDRESS OF SOURCE DATA W # 6, D1 TILE/PAL OFFSET IS SPRITENUM<<6 CHAINED SPRITES MOVE AND SCALE AS ONE UNIT. W # $0040, $3C0002 MARK THIS SPRITE AS CHAINED. W D7, $3C0002 EACH STRIP HAS ITS OWN SHRINK VALUE. B # 2, D2 WE NEED TO LOOP (SPRITE_WIDTH-2) TIMES. IN THIS EXAMPLE THE YIN-YANGS ARE 8 TILES WIDE, THIS BRANCH IS NEVER TAKEN. B # 1, D2 IS THIS SPRITE EXACTLY ONE TILE WIDE?īEQ skipChainedOAM A 1-WIDE SPRITE NEEDS NO CHAINED SPRITES. AUTO INCS TO $8401 WHICH IS WHERE X POS MUST BE STORED.ĬMP. W D3, D1 COMBINE WITH SPRITE HEIGHT,SINCE NEOGEO STORES THEM TOGETHER AS ONE UNIT. AUTO INCS TO $8201 WHICH IS WHERE Y POS MUST BE STORED. W D7, $3C0002 WRITE SIZE PARAMETER TO VRAM W D0, $3C0000 SET DESTINATION ADDRESS OF SIZE PARAMETER INCREMENT THE VALUE IN $3C0000 BY $200 AFTER EACH WRITE TO W # $00FF, D3 BYTE SANITIZE SPRITE HEIGHT B ( A0 ) +, D3 SPRITE HEIGHT - 8 TILES PER SPRITEĪND. (A NEOGEO SPRITE IS ALWAYS 1 TILE WIDE BUT CAN BE OF ARBITRARY HEIGHT) B ( A0 ) +, D2 SPRITE WIDTH - 8 SPRITES PER OBJECT LEA YinYang_Data, A0 LOAD ADDRESS OF SPRITE METADATA THESE VALUES ARE PASSED IN USING THE ABOVE REGISTERSĪDD. all this does is copy the sprite data to video memory.
this is just boilerplate required to show hardware sprites to the screen, it's not really relevant to the task. two different sprite objects do not overlap! the yin-yang is 8 sprites total, it is important that base sprite number, needed by NEOGEO hardware
Yin and yang symbol a color full#
(A sprite's tiles must be drawn in ROM at full size.) A value of 0x0FFF is full-size, and the sprite gets smaller as the value decreases. Each sprite has a shrink variable that is written to offset 0x8000 in video memory. The NEOGEO's hardware-supported sprite scaling helps a lot with this task.