Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,21 @@
|
|||
doRNG:
|
||||
;run this during vblank for best results.
|
||||
JSR SYS_READ_CALENDAR
|
||||
;gets the calendar.
|
||||
;MAME uses your computer's time for this.
|
||||
MOVE.L BIOS_HOUR,D0 ;D0 = HHMMSS00
|
||||
LSR.L #8,D0 ;shift out the zeroes.
|
||||
MOVE.L frame_timer,D1 ;this value is incremented by 1 every vBlank (i.e. just before this procedure is run)
|
||||
NOT.L D1 ;flip all the bits of D1
|
||||
MULS D1,D0
|
||||
MULU D1,D0
|
||||
MOVE.L JOYPAD1,D1 ;get the most recent button presses.
|
||||
CloneByte D1 ;copy this byte to all 4 bytes of D1
|
||||
EOR.L D1,D0
|
||||
MOVE.L RNGout_32,D2 ;look at last time's results.
|
||||
AND.B #1,D2 ;check if it's odd or even
|
||||
BNE SwapRNGifEven
|
||||
SWAP D0 ;if even, swap the low and high words of D0
|
||||
SwapRNGifEven:
|
||||
MOVE.L D0,RNGout_32
|
||||
rts
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
macro CloneByte 1
|
||||
;\1 must be a data register.
|
||||
;copies the lowest byte to all 4 bytes.
|
||||
move.b \1,-(SP)
|
||||
LSL.L #8,\1
|
||||
move.b (SP)+,\1
|
||||
pushWord \1
|
||||
SWAP \1
|
||||
popWord \1
|
||||
endm
|
||||
Loading…
Add table
Add a link
Reference in a new issue