Jump to content

Yin and yang: Difference between revisions

m
(this page lags my computer, will return here to fix entry once 68000 section is established)
Line 78:
=={{header|68000 Assembly}}==
{{works with|NEOGEO}}
Each sprite has a shrink variable that is written to offset 0x8000 in video memory. A value of 0x0FFF is full-size, and the sprite gets smaller as the value decreases. (A sprite's tiles must be drawn in ROM at full size.)
 
This code uses the following macros:
<pre>
Line 131:
MOVE.W D4,D1 ;GET Y POS
OR.W D3,D1 ;COMBINE WITH SPRITE HEIGHT,SINCE NEOGEO STORES THEM TOGETHER AS ONE UNIT.
MOVE.W D1,$3C0002 ;STORE IN SCB3
Line 150:
MOVE.W D0,$3C0000 ;SET VRAM DESTINATION.
MOVE.W D7,$3C0002 ;EACH STRIP HAS ITS OWN SHRINK VALUE.
MOVE.W #$0040,$3C0002 ;MARK THIS SPRITE AS CHAINED
MOVE.W #$0000,$3C0002 ;DUMMY MOVE FOR PADDING
DBRA D2,loop_generateChainedOAM
popWord D2
Line 172:
loop_sprite_OAM:
MOVE.W D1,$3C0000 ;SET VRAM ADDRESS
loop_tile_OAM:
MOVE.W (A0)+,$3C0002 ;SET TILE DATA
Line 178:
DBRA D3,loop_tile_OAM ;NEXT TILE IN STRIP
MOVE.W D6,D3 ;RESTORE D3
ADD.W #$0040,D1 ;NEXT SPRITE
DBRA D2,loop_sprite_OAM ;REPEAT UNTIL ALL SPRITES FINISHED.
Line 185:
YinYang_Data:
DC.B 8,8 ;SPRITE WIDTH,SPRITE HEIGHT
DC.W $0FFF ;SHRINK (NOT USED HERE, WAS PASSED BY CALLING FUNCTION)
DC.W $F800 ;Y (NOT USED HERE, WAS PASSED BY CALLING FUNCTION)
DC.W $2000 ;X (NOT USED HERE, WAS PASSED BY CALLING FUNCTION)
 
YinYang_Tile: ;EACH NUMBER REPRESENTS A TILE IN THE CHARACTER ROM
Line 209:
DC.W $0100,$0100,$0100,$0100,$0100,$0100,$0100,$0100</lang>
 
And here is the output: [https://ibb.co/fDxTXhY Screenshot of NEOGEO displaying two Yin-Yangs]
Will edit later with output.
 
=={{header|Ada}}==
{{libheader|GtkAda}}
1,489

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.