; NAME: Chance Time EX
; GAMES: MP3_USA
; EXECUTION: Direct
; PARAM: Space|SpaceToFace

ADDIU SP SP -104
SW RA 100(SP)
SW S0 68(SP)
SW S1 72(SP)
SW S2 76(SP)
SW S3 80(SP)
SW S4 84(SP) ; Model Pointer
SW S5 88(SP) ; Giver Index
SW S6 92(SP) ; Receiver Index
SW S7 96(SP) ; Event Index



LI A0 -1 ; Current Player
LI A1 -1 ; Idle
JAL SetBoardPlayerAnimation
LI A2 2 ; Loop

LI A0 -1 ; Current Player's Index
LI A1 8 ; Frames it takes to turn
LI A2 SpaceToFace
JAL 0x800ED20C ; RotatePlayerModel
NOP

JAL SleepProcess
LI A0 8

LI A0 5
JAL InitFadeOut
LI A1 16

JAL SleepProcess
LI A0 16

JAL PlayMusic
LI A0 66 ; Chance Time Music Index

JAL SleepProcess
LI A0 15

JAL PlaySound
LI A0 0x248 ; Crowd Cheering

JAL SleepProcess
LI A0 45

; S0 = ModelSpaceData
; S1 = ModelDataFromPointer

; ==GET MODEL SPACE DATA==
LI A0 SpaceToFace
JAL GetSpaceData
NOP
MOVE S0 V0

; ==GET MODEL DATA FROM POINTER==
LI A0 27 ; Toad Model
JAL 0x800D90C8
LI A1 0

MOVE S4 V0 ; Copy to S4

; ==PUT MODEL ON SPACE==
MOVE A1 S0
ADDIU A1 A1 8
MOVE A0 V0
ADDIU A0 A0 12 
JAL 0x80089A20 ; SetModelOnBoard
NOP

LI A0 5
JAL InitFadeIn
LI A1 16

JAL SleepProcess
LI A0 16


LI S5 15 ; Giver Index
LI S6 15 ; Receiver Index
LI S7 15 ; Chance Time Event

JAL PlaySound
LI A0 0x298 ; Toad: Yooo!

SW R0 16(SP) ; A4
SW R0 20(SP) ; A5
SW R0 24(SP) ; A6
LI A0 0x3 ; Character image (Toad)
LUI A1 hi(Greeting_Message)
ADDIU A1 A1 lo(Greeting_Message)
LI A2 0
JAL ShowMessage
LI A3 0

JAL CloseMessage
NOP
jal   0x800EC9DC
       NOP
jal   0x800EC6EC
       NOP

PROMPT:
SW R0 16(SP) ; A4
SW R0 20(SP) ; A5
SW R0 24(SP) ; A6
LI A0 0x3 ; Character image (Toad)
LUI A1 hi(Introduction_Prompt)
ADDIU A1 A1 lo(Introduction_Prompt)
LI A2 0
JAL ShowMessage
LI A3 0

JAL AIChoice ; AI's Choice at V0
NOP

LI A0 2
JAL GetBasicPromptSelection
MOVE A1 V0 ; A1 now has the AI's decision
MOVE S0 V0 ; S0 now has the chosen option index

JAL CloseMessage
NOP
jal   0x800EC9DC
       NOP
jal   0x800EC6EC
       NOP

LI A0 0
BEQ S0 A0 giver
NOP
LI A0 1
BEQ S0 A0 receiver
NOP
LI A0 2
BEQ S0 A0 event
NOP
LI A0 3
BEQ S0 A0 determinegiver
NOP

JAL ViewBoardMap
NOP
J PROMPT
NOP


giver:
JAL GetPlayerCharacterString ; V0 for P1's Character String
NOP

SW V1 16(SP) ; A4
SW T2 20(SP) ; A5
SW T0 24(SP) ; A6
LI A0 0x3 ; Character image (Toad)
LUI A1 hi(Giver_Prompt)
ADDIU A1 A1 lo(Giver_Prompt)
MOVE A2 V0
JAL ShowMessage
LI A3 0

JAL AIChoice ; AI's Choice at V0
NOP

LI A0 2
JAL GetBasicPromptSelection
MOVE A1 V0 ; A1 now has the AI's decision
MOVE S5 V0 ; S5 now has the giver index

JAL CloseMessage
NOP
jal   0x800EC9DC
       NOP
jal   0x800EC6EC
       NOP

LI A0 4
BEQ S5 A0 PROMPT
NOP

J determinereceiver
NOP



receiver:
JAL GetPlayerCharacterString ; V0 for P1's Character String
NOP

SW V1 16(SP) ; A4
SW T2 20(SP) ; A5
SW T0 24(SP) ; A6
LI A0 0x3 ; Character image (Toad)
LUI A1 hi(Receiver_Prompt)
ADDIU A1 A1 lo(Receiver_Prompt)
MOVE A2 V0
JAL ShowMessage
LI A3 0

JAL AIChoice ; AI's Choice at V0
NOP

LI A0 2
JAL GetBasicPromptSelection
MOVE A1 V0 ; A1 now has the AI's decision
MOVE S6 V0 ; S0 now has the receiver index

JAL CloseMessage
NOP
jal   0x800EC9DC
       NOP
jal   0x800EC6EC
       NOP

LI A0 4
BEQ S6 A0 PROMPT
NOP

J determinegiver
NOP


event:
SW R0 16(SP) ; A4
SW R0 20(SP) ; A5
SW R0 24(SP) ; A6
LI A0 3 ; Character image (Toad)
LUI A1 hi(Event_Prompt)
ADDIU A1 A1 lo(Event_Prompt)
LI A2 0
JAL ShowMessage
LI A3 0

JAL AIChoiceEvent ; AI's Choice at V0
NOP

LI A0 2
JAL GetBasicPromptSelection
MOVE A1 V0 ; A1 now has the AI's decision
MOVE S7 V0 ; S0 now has the receiver index

JAL CloseMessage
NOP
jal   0x800EC9DC
       NOP
jal   0x800EC6EC
       NOP

LI A0 9
BEQ S7 A0 PROMPT
NOP


determinegiver:
BEQ S7 R0 determineparticipant_1
NOP
LI T0 3
BEQ S7 T0 determineparticipant_1
NOP

SW R0 16(SP) ; A4
SW R0 20(SP) ; A5
SW R0 24(SP) ; A6
LI A0 0x3 ; Character image (Toad)
LUI A1 hi(DetermineGiver_Message)
ADDIU A1 A1 lo(DetermineGiver_Message)
LI A2 0
JAL ShowMessage
LI A3 0

JAL CloseMessage
NOP
jal   0x800EC9DC
       NOP
jal   0x800EC6EC
       NOP
       
J giverloop
NOP

determineparticipant_1:
SW R0 16(SP) ; A4
SW R0 20(SP) ; A5
SW R0 24(SP) ; A6
LI A0 0x3 ; Character image (Toad)
LUI A1 hi(DetermineParticipant1_Message)
ADDIU A1 A1 lo(DetermineParticipant1_Message)
LI A2 0
JAL ShowMessage
LI A3 0

JAL CloseMessage
NOP
jal   0x800EC9DC
       NOP
jal   0x800EC6EC
       NOP


giverloop:
JAL GetRandomByte ; 0-255 at V0
NOP

LI T0 4
DIVU V0 T0
MFHI S5

BEQ S5 S6 giverloop
NOP

JAL PlaySound
LI A0 0x3EC ; Drumroll

JAL SleepProcess
LI A0 30

JAL PlaySound
LI A0 0x3ED ; Drumroll end

JAL SleepProcess
LI A0 30

MOVE A0 S5
JAL GetSelectedPlayerCharacterString
NOP

SW R0 16(SP) ; A4
SW R0 20(SP) ; A5
SW R0 24(SP) ; A6
LI A0 0x3 ; Character image (Toad)
LUI A1 hi(AnnounceGiver_Message)
ADDIU A1 A1 lo(AnnounceGiver_Message)
MOVE A2 V0 ; Copy Selected Character's Name to A2
JAL ShowMessage
LI A3 0

JAL CloseMessage
NOP
jal   0x800EC9DC
       NOP
jal   0x800EC6EC
       NOP


determinereceiver:
LI T0 15
BNE S6 T0 determineevent
NOP
BEQ S7 R0 determineparticipant_2
NOP
LI T0 3
BEQ S7 T0 determineparticipant_2
NOP

SW R0 16(SP) ; A4
SW R0 20(SP) ; A5
SW R0 24(SP) ; A6
LI A0 0x3 ; Character image (Toad)
LUI A1 hi(DetermineReceiver_Message)
ADDIU A1 A1 lo(DetermineReceiver_Message)
LI A2 0
JAL ShowMessage
LI A3 0

JAL CloseMessage
NOP
jal   0x800EC9DC
       NOP
jal   0x800EC6EC
       NOP
J receiverloop
NOP

determineparticipant_2:
SW R0 16(SP) ; A4
SW R0 20(SP) ; A5
SW R0 24(SP) ; A6
LI A0 0x3 ; Character image (Toad)
LUI A1 hi(DetermineParticipant2_Message)
ADDIU A1 A1 lo(DetermineParticipant2_Message)
LI A2 0
JAL ShowMessage
LI A3 0

JAL CloseMessage
NOP
jal   0x800EC9DC
       NOP
jal   0x800EC6EC
       NOP


receiverloop:
JAL GetRandomByte ; 0-255 at V0
NOP

LI T0 4
DIVU V0 T0
MFHI S6

BEQ S6 S5 receiverloop
NOP

JAL PlaySound
LI A0 0x3EC ; Drumroll

JAL SleepProcess
LI A0 30

JAL PlaySound
LI A0 0x3ED ; Drumroll end

JAL SleepProcess
LI A0 30

MOVE A0 S6
JAL GetSelectedPlayerCharacterString
NOP

SW R0 16(SP) ; A4
SW R0 20(SP) ; A5
SW R0 24(SP) ; A6
LI A0 0x3 ; Character image (Toad)
LUI A1 hi(AnnounceReceiver_Message)
ADDIU A1 A1 lo(AnnounceReceiver_Message)
MOVE A2 V0 ; Copy Selected Character's Name to A2
JAL ShowMessage
LI A3 0

JAL CloseMessage
NOP
jal   0x800EC9DC
       NOP
jal   0x800EC6EC
       NOP



determineevent:
LI T0 0 ; Swap Stars Index
BEQ S7 T0 SwapStars_2
NOP
LI S3 2 
LI T0 1 ; 2 Stars Index
BEQ S7 T0 LoseStars
NOP
LI S3 1
LI T0 2 ; 1 Star Index
BEQ S7 T0 LoseStars
NOP
LI T0 3 ; Swap Coins Index
BEQ S7 T0 SwapCoins_2
NOP
LI S3 40
LI T0 4 ; 40 Coin Index
BEQ S7 T0 LoseCoins
NOP
LI S3 30
LI T0 5 ; 30 Coins Index
BEQ S7 T0 LoseCoins
NOP
LI S3 20
LI T0 6 ; 20 Coins Index
BEQ S7 T0 LoseCoins
NOP
LI S3 10
LI T0 7 ; 10 Coins Index
BEQ S7 T0 LoseCoins
NOP
LI S3 1
LI T0 8 ; 1 Coins Index
BEQ S7 T0 LoseCoins
NOP

SW R0 16(SP) ; A4
SW R0 20(SP) ; A5
SW R0 24(SP) ; A6
LI A0 0x3 ; Character image (Toad)
LUI A1 hi(DetermineEvent_Message)
ADDIU A1 A1 lo(DetermineEvent_Message)
LI A2 0
JAL ShowMessage
LI A3 0

JAL CloseMessage
NOP
jal   0x800EC9DC
       NOP
jal   0x800EC6EC
       NOP

JAL PlaySound
LI A0 0x3EC ; Drumroll

JAL SleepProcess
LI A0 30

JAL PlaySound
LI A0 0x3ED ; Drumroll end

JAL SleepProcess
LI A0 30

JAL GetRandomByte ; 0-255 at V0
NOP

SLTI T0 V0 19
NOP
BNE T0 R0 SwapStars
NOP
SLTI T0 V0 38
NOP
BNE T0 R0 TwoStars
NOP
SLTI T0 V0 78
NOP
BNE T0 R0 OneStar
NOP
SLTI T0 V0 97
NOP
BNE T0 R0 SwapCoins
NOP
SLTI T0 V0 116
NOP
BNE T0 R0 FortyCoins
NOP
SLTI T0 V0 136
NOP
BNE T0 R0 ThirtyCoins
NOP
SLTI T0 V0 176
NOP
BNE T0 R0 TwentyCoins
NOP
SLTI T0 V0 216
NOP
BNE T0 R0 TenCoins
NOP
J OneCoin
NOP

SwapStars:
LUI S0 hi(AnnounceSwapStars_Message)
ADDIU S0 S0 lo(AnnounceSwapStars_Message)
LI S7 0 ; Swap Stars Index
J FinishMessage
NOP

TwoStars:
LUI S0 hi(AnnounceTwoStars_Message)
ADDIU S0 S0 lo(AnnounceTwoStars_Message)
LI S7 1 ; 2 Stars Index
J FinishMessage
NOP

OneStar:
LUI S0 hi(AnnounceOneStar_Message)
ADDIU S0 S0 lo(AnnounceOneStar_Message)
LI S7 2 ; 1 Star Index
J FinishMessage
NOP

SwapCoins:
LUI S0 hi(AnnounceSwapCoins_Message)
ADDIU S0 S0 lo(AnnounceSwapCoins_Message)
LI S7 3 ; Coin Swap Index
J FinishMessage
NOP

FortyCoins:
LUI S0 hi(AnnounceFortyCoins_Message)
ADDIU S0 S0 lo(AnnounceFortyCoins_Message)
LI S7 4 ; 40 Coins Index
J FinishMessage
NOP

ThirtyCoins:
LUI S0 hi(AnnounceThirtyCoins_Message)
ADDIU S0 S0 lo(AnnounceThirtyCoins_Message)
LI S7 5 ; 30 Coins Index
J FinishMessage
NOP

TwentyCoins:
LUI S0 hi(AnnounceTwentyCoins_Message)
ADDIU S0 S0 lo(AnnounceTwentyCoins_Message)
LI S7 6 ; 20 Coins Index
J FinishMessage
NOP

TenCoins:
LUI S0 hi(AnnounceTenCoins_Message)
ADDIU S0 S0 lo(AnnounceTenCoins_Message)
LI S7 7 ; 10 Coins Index
J FinishMessage
NOP

OneCoin:
LUI S0 hi(AnnounceOneCoin_Message)
ADDIU S0 S0 lo(AnnounceOneCoin_Message)
LI S7 8 ; 1 Coin Index

FinishMessage:
SW R0 16(SP) ; A4
SW R0 20(SP) ; A5
SW R0 24(SP) ; A6
LI A0 0x3 ; Character image (Toad)
MOVE A1 S0
LI A2 0
JAL ShowMessage
LI A3 0

JAL CloseMessage
NOP
jal   0x800EC9DC
       NOP
jal   0x800EC6EC
       NOP

J determineevent
NOP



SwapStars_2:
LUI T0 hi(p1_stars)
ADDIU T0 T0 lo(p1_stars) ; Load Player 1's Stars address
LI T2 0x38 ; Distance between each player's addresses
MULT S5 T2 ; Multiply Current Player Index by T2
MFLO T2 ; Move Result to T2
ADDU S0 T0 T2 ; Add results to get current Player's Stars address
LBU S2 0(S0) ; Load the value address value of T0 into S2

LUI T0 hi(p1_stars)
ADDIU T0 T0 lo(p1_stars) ; Load Player 1's Stars address
LI T2 0x38 ; Distance between each player's addresses
MULT S6 T2 ; Multiply Current Player Index by T2
MFLO T2 ; Move Result to T2
ADDU S1 T0 T2 ; Add results to get current Player's Stars address
LBU S3 0(S1) ; Load the value address value of T0 into S2

SB S2 0(S1)
SB S3 0(S0)

JAL PlaySound
LI A0 283 ; Star Space Sound Index?

JAL SleepProcess
LI A0 30

J goodbye
NOP

LoseStars:
LUI T0 hi(p1_stars)
ADDIU T0 T0 lo(p1_stars) ; Load Player 1's Stars address
LI T2 0x38 ; Distance between each player's addresses
MULT S5 T2 ; Multiply Current Player Index by T2
MFLO T2 ; Move Result to T2
ADDU S0 T0 T2 ; Add results to get current Player's Stars address
LBU S2 0(S0) ; Load the value address value of T0 into S2

BEQ S2 R0 NoStars
NOP

SLT T0 S2 S3
NOP
BNE T0 R0 MissingStars
NOP

takingthestars:
SUBU T0 S2 S3
SB T0 0(S0)

LUI T0 hi(p1_stars)
ADDIU T0 T0 lo(p1_stars) ; Load Player 1's Stars address
LI T2 0x38 ; Distance between each player's addresses
MULT S6 T2 ; Multiply Current Player Index by T2
MFLO T2 ; Move Result to T2
ADDU S0 T0 T2 ; Add results to get current Player's Stars address
LBU S2 0(S0) ; Load the value address value of T0 into S2

ADDU T0 S2 S3
SB T0 0(S0)

JAL PlaySound
LI A0 283 ; Star Space Sound Index?

JAL SleepProcess
LI A0 30

J goodbye
NOP

MissingStars:
JAL PlaySound
LI A0 0x29A ; Toad: Oooh! :(

SW R0 16(SP) ; A4
SW R0 20(SP) ; A5
SW R0 24(SP) ; A6
LI A0 0x3 ; Character image (Toad)
LUI A1 hi(MissingStars_Message)
ADDIU A1 A1 lo(MissingStars_Message)
LI A2 0
JAL ShowMessage
LI A3 0

JAL CloseMessage
NOP
jal   0x800EC9DC
       NOP
jal   0x800EC6EC
       NOP

MOVE S3 S2
J takingthestars
NOP


NoStars:
JAL PlaySound
LI A0 0x29A ; Toad: Oooh! :(

SW R0 16(SP) ; A4
SW R0 20(SP) ; A5
SW R0 24(SP) ; A6
LI A0 0x3 ; Character image (Toad)
LUI A1 hi(NoStars_Message)
ADDIU A1 A1 lo(NoStars_Message)
LI A2 0
JAL ShowMessage
LI A3 0

JAL CloseMessage
NOP
jal   0x800EC9DC
       NOP
jal   0x800EC6EC
       NOP
       
J goodbye
NOP

SwapCoins_2:
LUI T0 hi(p1_coins)
ADDIU T0 T0 lo(p1_coins) ; Load Player 1's Coins address
LI T2 0x38 ; Distance between each player's addresses
MULT S5 T2 ; Multiply Current Player Index by T2
MFLO T2 ; Move Result to T2
ADDU T0 T0 T2 ; Add results to get current Player's Coins address
LHU S3 0(T0) ; Load the value address value of T0 into S3

MOVE A0 S5 
JAL AdjustPlayerCoinsGradual
SUBU A1 R0 S3

LUI T0 hi(p1_coins)
ADDIU T0 T0 lo(p1_coins) ; Load Player 1's Coins address
LI T2 0x38 ; Distance between each player's addresses
MULT S6 T2 ; Multiply Current Player Index by T2
MFLO T2 ; Move Result to T2
ADDU T0 T0 T2 ; Add results to get current Player's Coins address
LHU S2 0(T0) ; Load the value address value of T0 into S2

MOVE A0 S6 
JAL AdjustPlayerCoinsGradual
SUBU A1 R0 S2

JAL SleepProcess
LI A0 30

MOVE A0 S5 
JAL AdjustPlayerCoinsGradual
MOVE A1 S2

MOVE A0 S6
JAL AdjustPlayerCoinsGradual
MOVE A1 S3

JAL SleepProcess
LI A0 30
J goodbye
NOP


LoseCoins:
MOVE A0 S5
JAL PlayerHasCoins
LI A1 1

BEQ V0 R0 NoCoins
NOP

MOVE A0 S5
JAL PlayerHasCoins
MOVE A1 S3

BEQ V0 R0 MissingCoins
NOP

takingthecoins:
MOVE A0 S5 ; Take Coins from the Giver
JAL AdjustPlayerCoinsGradual
SUBU A1 R0 S3

JAL SleepProcess
LI A0 30

MOVE A0 S6 ; Give Coins to the Receiver
JAL AdjustPlayerCoinsGradual
MOVE A1 S3

JAL SleepProcess
LI A0 30
J goodbye
NOP


MissingCoins:
JAL PlaySound
LI A0 0x29A ; Toad: Oooh! :(

SW R0 16(SP) ; A4
SW R0 20(SP) ; A5
SW R0 24(SP) ; A6
LI A0 0x3 ; Character image (Toad)
LUI A1 hi(MissingCoins_Message)
ADDIU A1 A1 lo(MissingCoins_Message)
LI A2 0
JAL ShowMessage
LI A3 0

JAL CloseMessage
NOP
jal   0x800EC9DC
       NOP
jal   0x800EC6EC
       NOP

LUI T0 hi(p1_coins)
ADDIU T0 T0 lo(p1_coins) ; Load Player 1's Coins address
LI T2 0x38 ; Distance between each player's addresses
MULT S5 T2 ; Multiply Current Player Index by T2
MFLO T2 ; Move Result to T2
ADDU T0 T0 T2 ; Add results to get current Player's Character address
LHU S3 0(T0) ; Load the value address value of S0 into S2

J takingthecoins
NOP


NoCoins:
JAL PlaySound
LI A0 0x29A ; Toad: Oooh! :(

SW R0 16(SP) ; A4
SW R0 20(SP) ; A5
SW R0 24(SP) ; A6
LI A0 0x3 ; Character image (Toad)
LUI A1 hi(NoCoins_Message)
ADDIU A1 A1 lo(NoCoins_Message)
LI A2 0
JAL ShowMessage
LI A3 0

JAL CloseMessage
NOP
jal   0x800EC9DC
       NOP
jal   0x800EC6EC
       NOP

goodbye:
SW R0 16(SP) ; A4
SW R0 20(SP) ; A5
SW R0 24(SP) ; A6
LI A0 0x3 ; Character image (Toad)
LUI A1 hi(Goodbye_Message)
ADDIU A1 A1 lo(Goodbye_Message)
LI A2 0
JAL ShowMessage
LI A3 0

JAL CloseMessage
NOP
jal   0x800EC9DC
       NOP
jal   0x800EC6EC
       NOP

LI A0 5
JAL InitFadeOut
LI A1 16

JAL SleepProcess
LI A0 17

JAL GetBoardAudioIndex
NOP

JAL PlayMusic
MOVE A0 V0

JAL 0x800D9B54 ; Removes Toad from the board
MOVE A0 S4 ; Toad Model Pointer

LI A0 5
JAL InitFadeIn
LI A1 16

JAL SleepProcess
LI A0 16



exit:
LW RA 100(SP)
LW S0 68(SP)
LW S1 72(SP)
LW S2 76(SP)
LW S3 80(SP)
LW S4 84(SP)
LW S5 88(SP)
LW S6 92(SP)
LW S7 96(SP)
JR RA
ADDIU SP SP 104

AIChoice:
ADDIU SP SP -64
SW RA 60(SP)

LI V0 0

LW RA 60(SP)
JR RA
ADDIU SP SP 64

.align 4
AIChoiceEvent:
ADDIU SP SP -56
SW RA 52(SP)

LI V0 0

LW RA 52(SP)
JR RA
ADDIU SP SP 56

.align 4
GetPlayerCharacterString:
ADDIU SP SP -40
SW RA 36(SP)

LUI T1 hi(p1_char)
ADDIU T1 T1 lo(p1_char) ; Load Player 1's Character address
LBU T0 0(T1)
ADDIU V0 T0 0x1C00 ; MARIO String

ADDIU T1 T1 0x38 ; Load Player 2's Character Address
LBU T0 0(T1)
ADDIU V1 T0 0x1C00 ; MARIO String

ADDIU T1 T1 0x38 ; Load Player 3's Character Address
LBU T0 0(T1)
ADDIU T2 T0 0x1C00 ; MARIO String

ADDIU T1 T1 0x38 ; Load Player 4's Character Address
LBU T0 0(T1)
ADDIU T0 T0 0x1C00 ; MARIO String

LW RA 36(SP)
JR RA
ADDIU SP SP 40

.align 4
GetSelectedPlayerCharacterString:
; A0 = Current Player's Index
ADDIU SP SP -32
SW RA 28(SP)

LUI T0 hi(p1_char)
ADDIU T0 T0 lo(p1_char) ; Load Player 1's Character address
LI T2 0x38 ; Distance between each player's addresses
MULT A0 T2 ; Multiply Current Player Index by T2
MFLO T2 ; Move Result to T2
ADDU T0 T0 T2 ; Add results to get current Player's Character address
LBU T2 0(T0) ; Load the value address value of S0 into S2

LI V0 0x1C00 ; Load value of MARIO string to T0
ADDU V0 T2 V0 ; Add T2 to the string value to obtain the character

LW RA 28(SP)
JR RA
ADDIU SP SP 32



.align 16
Greeting_Message:
.byte 0x1A,0x1A,0x1A,0x1A ; Standard padding for picture
.ascii "Welcome to"
.byte 0x05 ; Green Font
.ascii " Chance Time EX"
.byte 0x08 ; White Font
.byte 0xC2 ; Exclamation Mark (!)
.byte 0x0A,0x1A,0x1A,0x1A,0x1A ; Newline+Standard padding for picture
.ascii "The exciting"
.ascii "event everyone loves"
.byte 0xC2 ; Exclamation Mark (!)
.byte 0x0A,0x1A,0x1A,0x1A,0x1A ; Newline+Standard padding for picture
.byte 0x85,0x85,0x85 ; Period (.)
.ascii "Until they"
.byte 0x5C ; Apostrophe (')
.ascii "re on the giving end"
.byte 0x85 ; Period (.)
.byte 0xFF,0 ; FF=Pause

.align 16
Introduction_Prompt:
.byte 0x0B ; Start the message
.byte 0x1A,0x1A,0x1A,0x1A ; Standard padding for picture
.ascii "You may choose the"
.byte 0x03 ; Red Font
.ascii "giver"
.byte 0x08 ; White Font
.byte 0x82 ; Comma (,)
.ascii " the"
.byte 0x0A,0x1A,0x1A,0x1A ; Newline+Standard padding for picture
.byte 0x06 ; Blue font
.ascii "  receiver"
.byte 0x08 ; White Font
.byte 0x82 ; Comma (,)
.ascii " or the"
.byte 0x05 ; Green Font
.ascii "event"
.byte 0x08 ; White Font
.ascii " that will happen"
.byte 0xC2 ; Exclamation Mark (!)
.byte 0x0A,0x1A,0x1A,0x1A,0x1A ; Newline+Standard padding for picture
.ascii "The rest is up to lady luck"
.byte 0xC2 ; Exclamation Mark (!)
.byte 0x0A,0x0A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A ; Padding Picture
.byte 0x0C ; Start option
.ascii "Select Giver"
.byte 0x0D ; End option
.byte 0x0A ; New Line (Writes Below)
.byte 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A ; Picture + Option Indent
.byte 0x0C ; Start option
.ascii "Select Receiver"
.byte 0x0D ; End option
.byte 0x0A ; New Line (Writes Below)
.byte 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A ; Picture + Option Indent
.byte 0x0C ; Start option
.ascii "Select Event"
.byte 0x0D ; End option
.byte 0x0A ; New Line (Writes Below)
.byte 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A ; Picture + Option Indent
.byte 0x0C ; Start option
.ascii "All Random"
.byte 0x0D ; End option
.byte 0x0A ; New Line (Writes Below)
.byte 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A ; Picture + Option Indent
.byte 0x0C ; Start option
.ascii "View Map"
.byte 0x0D ; End option
.byte 0 ; End Prompt

.align 16
Giver_Prompt:
.byte 0x1A,0x1A,0x1A,0x1A ; Standard padding for picture
.ascii "Who will be our unlucky donor"
.byte 0xC3 ; Question Mark (?)
.byte 0x0A,0x0A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A ; Newline+Padding
.byte 0x0C ; Start option
.byte 0x11 ; String #1
.byte 0x0D ; End option
.byte 0x0A ; New Line (Writes Below)
.byte 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A ; Picture + Option Indent
.byte 0x0C ; Start option
.byte 0x13 ; String #3
.byte 0x0D ; End option
.byte 0x0A ; New Line (Writes Below)
.byte 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A ; Picture + Option Indent
.byte 0x0C ; Start option
.byte 0x14 ; String #4
.byte 0x0D ; End option
.byte 0x0A ; New Line (Writes Below)
.byte 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A ; Picture + Option Indent
.byte 0x0C ; Start option
.byte 0x15 ; String #5
.byte 0x0D ; End option
.byte 0x0A ; New Line (Writes Below)
.byte 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A ; Picture + Option Indent
.byte 0x0C ; Start option
.ascii "Go back"
.byte 0x0D ; End option
.byte 0 ; End Prompt

.align 16
Receiver_Prompt:
.byte 0x1A,0x1A,0x1A,0x1A ; Standard padding for picture
.ascii "Who will be our lucky recipient"
.byte 0xC3 ; Question Mark (?)
.byte 0x0A,0x0A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A ; Newline+Padding
.byte 0x0C ; Start option
.byte 0x11 ; String #1
.byte 0x0D ; End option
.byte 0x0A ; New Line (Writes Below)
.byte 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A ; Picture + Option Indent
.byte 0x0C ; Start option
.byte 0x13 ; String #3
.byte 0x0D ; End option
.byte 0x0A ; New Line (Writes Below)
.byte 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A ; Picture + Option Indent
.byte 0x0C ; Start option
.byte 0x14 ; String #4
.byte 0x0D ; End option
.byte 0x0A ; New Line (Writes Below)
.byte 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A ; Picture + Option Indent
.byte 0x0C ; Start option
.byte 0x15 ; String #5
.byte 0x0D ; End option
.byte 0x0A ; New Line (Writes Below)
.byte 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A ; Picture + Option Indent
.byte 0x0C ; Start option
.ascii "Go back"
.byte 0x0D ; End option
.byte 0 ; End Prompt

.align 16
Event_Prompt:
.byte 0x1A,0x1A,0x1A,0x1A ; Standard padding for picture
.ascii "What will be today"
.byte 0x5C ; Apostrophe (')
.ascii "s exciting"
.ascii "event"
.byte 0xC3 ; Question Mark (?)
.byte 0x0A,0x0A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A ; Newline+Padding
.byte 0x0C ; Start option
.ascii "Swap Stars"
.byte 0x0D ; End option
.byte 0x0A ; New Line (Writes Below)
.byte 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A ; Picture + Option Indent
.byte 0x0C ; Start option
.ascii "2 Stars"
.byte 0x0D ; End option
.byte 0x0A ; New Line (Writes Below)
.byte 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A ; Picture + Option Indent
.byte 0x0C ; Start option
.ascii "1 Star"
.byte 0x0D ; End option
.byte 0x0A ; New Line (Writes Below)
.byte 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A ; Picture + Option Indent
.byte 0x0C ; Start option
.ascii "Swap Coins"
.byte 0x0D ; End option
.byte 0x0A ; New Line (Writes Below)
.byte 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A ; Picture + Option Indent
.byte 0x0C ; Start option
.ascii "40 Coins"
.byte 0x0D ; End option
.byte 0x0A ; New Line (Writes Below)
.byte 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A ; Picture + Option Indent
.byte 0x0C ; Start option
.ascii "30 Coins"
.byte 0x0D ; End option
.byte 0x0A ; New Line (Writes Below)
.byte 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A ; Picture + Option Indent
.byte 0x0C ; Start option
.ascii "20 Coins"
.byte 0x0D ; End option
.byte 0x0A ; New Line (Writes Below)
.byte 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A ; Picture + Option Indent
.byte 0x0C ; Start option
.ascii "10 Coins"
.byte 0x0D ; End option
.byte 0x0A ; New Line (Writes Below)
.byte 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A ; Picture + Option Indent
.byte 0x0C ; Start option
.ascii "1 Coin"
.byte 0x0D ; End option
.byte 0x0A ; New Line (Writes Below)
.byte 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A ; Picture + Option Indent
.byte 0x0C ; Start option
.ascii "Go Back"
.byte 0x0D ; End option
.byte 0 ; End Prompt

.align 16
DetermineGiver_Message:
.byte 0x1A,0x1A,0x1A,0x1A ; Standard padding for picture
.ascii "First"
.byte 0x82 ; Comma (,)
.ascii " let"
.byte 0x5C ; Apostrophe (')
.ascii "s determine who will"
.byte 0x0A,0x1A,0x1A,0x1A,0x1A ; Newline+Standard padding for picture
.ascii "give out today"
.byte 0x5C ; Apostrophe (')
.ascii "s amazing prize"
.byte 0xC2 ; Exclamation Mark (!)
.byte 0x0A,0x1A,0x1A,0x1A,0x1A ; Newline+Standard padding for picture
.ascii "Are you ready"
.byte 0xC3 ; Question Mark (?)
.byte 0xFF,0 ; FF=Pause

.align 16
DetermineParticipant1_Message:
.byte 0x1A,0x1A,0x1A,0x1A ; Standard padding for picture
.ascii "First"
.byte 0x82 ; Comma (,)
.ascii " let"
.byte 0x5C ; Apostrophe (')
.ascii "s determine who will"
.byte 0x0A,0x1A,0x1A,0x1A,0x1A ; Newline+Standard padding for picture
.ascii "be today"
.byte 0x5C ; Apostrophe (')
.ascii "s first participant"
.byte 0xC2 ; Exclamation Mark (!)
.byte 0x0A,0x1A,0x1A,0x1A,0x1A ; Newline+Standard padding for picture
.ascii "Are you ready"
.byte 0xC3 ; Question Mark (?)
.byte 0xFF,0 ; FF=Pause

.align 16
AnnounceGiver_Message:
.byte 0x1A,0x1A,0x1A,0x1A ; Standard padding for picture
.byte 0x11 ; String #1
.byte 0xFF,0 ; FF=Pause

.align 16
DetermineReceiver_Message:
.byte 0x1A,0x1A,0x1A,0x1A ; Standard padding for picture
.ascii "Now"
.byte 0x82 ; Comma (,)
.ascii " let"
.byte 0x5C ; Apostrophe (')
.ascii "s determine who will"
.byte 0x0A,0x1A,0x1A,0x1A,0x1A ; Newline+Standard padding for picture
.ascii "receive today"
.byte 0x5C ; Apostrophe (')
.ascii "s amazing prize"
.byte 0xC2 ; Exclamation Mark (!)
.byte 0x0A,0x1A,0x1A,0x1A,0x1A ; Newline+Standard padding for picture
.ascii "Are you ready"
.byte 0xC3 ; Question Mark (?)
.byte 0xFF,0 ; FF=Pause

.align 16
AnnounceReceiver_Message:
.byte 0x1A,0x1A,0x1A,0x1A ; Standard padding for picture
.byte 0x11 ; String #1
.byte 0xFF,0 ; FF=Pause

.align 16
DetermineParticipant2_Message:
.byte 0x1A,0x1A,0x1A,0x1A ; Standard padding for picture
.ascii "Lastly"
.byte 0x82 ; Comma (,)
.ascii " let"
.byte 0x5C ; Apostrophe (')
.ascii "s determine who will"
.byte 0x0A,0x1A,0x1A,0x1A,0x1A ; Newline+Standard padding for picture
.ascii "be today"
.byte 0x5C ; Apostrophe (')
.ascii "s second participant"
.byte 0xC2 ; Exclamation Mark (!)
.byte 0x0A,0x1A,0x1A,0x1A,0x1A ; Newline+Standard padding for picture
.ascii "Are you ready"
.byte 0xC3 ; Question Mark (?)
.byte 0xFF,0 ; FF=Pause

.align 16
DetermineEvent_Message:
.byte 0x1A,0x1A,0x1A,0x1A ; Standard padding for picture
.ascii "Finally"
.byte 0x82 ; Comma (,)
.ascii " let"
.byte 0x5C ; Apostrophe (')
.ascii "s determine what"
.byte 0x0A,0x1A,0x1A,0x1A,0x1A ; Newline+Standard padding for picture
.ascii "will today"
.byte 0x5C ; Apostrophe (')
.ascii "s"
.ascii "event be"
.byte 0xC2 ; Exclamation Mark (!)
.byte 0x0A,0x1A,0x1A,0x1A,0x1A ; Newline+Standard padding for picture
.ascii "Are you ready"
.byte 0xC3 ; Question Mark (?)
.byte 0xFF,0 ; FF=Pause

.align 16
AnnounceSwapStars_Message:
.byte 0x1A,0x1A,0x1A,0x1A ; Standard padding for picture
.ascii "Wow"
.byte 0xC2,0xC2,0xC2 ; Exclamation Mark (!)
.byte 0x0A,0x1A,0x1A,0x1A,0x1A ; Newline+Standard padding for picture
.ascii "It looks like you"
.byte 0x5C ; Apostrophe (')
.ascii "re swapping stars"
.byte 0xC2 ; Exclamation Mark (!)
.byte 0xFF,0 ; FF=Pause

.align 16
AnnounceTwoStars_Message:
.byte 0x1A,0x1A,0x1A,0x1A ; Standard padding for picture
.ascii "2 STARS"
.byte 0xC2 ; Exclamation Mark (!)
.byte 0xFF,0 ; FF=Pause

.align 16
AnnounceOneStar_Message:
.byte 0x1A,0x1A,0x1A,0x1A ; Standard padding for picture
.ascii "1 STAR"
.byte 0xC2 ; Exclamation Mark (!)
.byte 0xFF,0 ; FF=Pause

.align 16
AnnounceSwapCoins_Message:
.byte 0x1A,0x1A,0x1A,0x1A ; Standard padding for picture
.ascii "Oh wow"
.byte 0xC2 ; Exclamation Mark (!)
.byte 0x0A,0x1A,0x1A,0x1A,0x1A ; Newline+Standard padding for picture
.ascii "It looks like you"
.byte 0x5C ; Apostrophe (')
.ascii "re swapping coins"
.byte 0xC2 ; Exclamation Mark (!)
.byte 0xFF,0 ; FF=Pause

.align 16
AnnounceFortyCoins_Message:
.byte 0x1A,0x1A,0x1A,0x1A ; Standard padding for picture
.ascii "40 COINS"
.byte 0xC2 ; Exclamation Mark (!)
.byte 0xFF,0 ; FF=Pause

.align 16
AnnounceThirtyCoins_Message:
.byte 0x1A,0x1A,0x1A,0x1A ; Standard padding for picture
.ascii "30 COINS"
.byte 0xC2 ; Exclamation Mark (!)
.byte 0xFF,0 ; FF=Pause

.align 16
AnnounceTwentyCoins_Message:
.byte 0x1A,0x1A,0x1A,0x1A ; Standard padding for picture
.ascii "20 COINS"
.byte 0xC2 ; Exclamation Mark (!)
.byte 0xFF,0 ; FF=Pause

.align 16
AnnounceTenCoins_Message:
.byte 0x1A,0x1A,0x1A,0x1A ; Standard padding for picture
.ascii "10 COINS"
.byte 0xC2 ; Exclamation Mark (!)
.byte 0xFF,0 ; FF=Pause

.align 16
AnnounceOneCoin_Message:
.byte 0x1A,0x1A,0x1A,0x1A ; Standard padding for picture
.ascii "1 WHOLE COIN"
.byte 0xC2,0xC2,0xC2 ; Exclamation Mark (!)
.byte 0xFF,0 ; FF=Pause

.align 16
NoCoins_Message:
.byte 0x1A,0x1A,0x1A,0x1A ; Standard padding for picture
.ascii "Oh"
.byte 0x82 ; Comma (,)
.ascii " it looks like they"
.byte 0x0A,0x1A,0x1A,0x1A,0x1A ; Newline+Standard padding for picture
.ascii "don"
.byte 0x5C ; Apostrophe (')
.ascii "t have any coins"
.byte 0x85,0x85,0x85 ; Period (...)
.byte 0x0A,0x1A,0x1A,0x1A,0x1A ; Newline+Standard padding for picture
.ascii "Oh well"
.byte 0xC2,0xC2,0xC2 ; Exclamation Mark (!)
.byte 0xFF,0 ; FF=Pause

.align 16
MissingCoins_Message:
.byte 0x1A,0x1A,0x1A,0x1A ; Standard padding for picture
.ascii "Oh"
.byte 0x82 ; Comma (,)
.ascii " it looks like they"
.byte 0x0A,0x1A,0x1A,0x1A,0x1A ; Newline+Standard padding for picture
.ascii "don"
.byte 0x5C ; Apostrophe (')
.ascii "t have enough coins"
.byte 0x85,0x85,0x85 ; Period (...)
.byte 0x0A,0x1A,0x1A,0x1A,0x1A ; Newline+Standard padding for picture
.ascii "At least it"
.byte 0x5C ; Apostrophe (')
.ascii "s something"
.byte 0xC2,0xC2,0xC2 ; Exclamation Mark (!)
.byte 0xFF,0 ; FF=Pause

.align 16
Goodbye_Message:
.byte 0x1A,0x1A,0x1A,0x1A ; Standard padding for picture
.ascii "That"
.byte 0x5C ; Apostrophe (')
.ascii "s all for today"
.byte 0xC2 ; Exclamation Mark (!)
.byte 0x0A,0x1A,0x1A,0x1A,0x1A ; Newline+Standard padding for picture
.ascii "Thank you for stopping by"
.byte 0xC2 ; Exclamation Mark (!)
.byte 0x0A,0x1A,0x1A,0x1A,0x1A ; Newline+Standard padding for picture
.ascii "Until next time"
.byte 0xC2 ; Exclamation Mark (!)
.byte 0xFF,0 ; FF=Pause

.align 16
NoStars_Message:
.byte 0x1A,0x1A,0x1A,0x1A ; Standard padding for picture
.ascii "Oh"
.byte 0x82 ; Comma (,)
.ascii " it looks like they"
.byte 0x0A,0x1A,0x1A,0x1A,0x1A ; Newline+Standard padding for picture
.ascii "don"
.byte 0x5C ; Apostrophe (')
.ascii "t have any stars"
.byte 0x85,0x85,0x85 ; Period (...)
.byte 0x0A,0x1A,0x1A,0x1A,0x1A ; Newline+Standard padding for picture
.ascii "Oh well"
.byte 0xC2,0xC2,0xC2 ; Exclamation Mark (!)
.byte 0xFF,0 ; FF=Pause

.align 16
MissingStars_Message:
.byte 0x1A,0x1A,0x1A,0x1A ; Standard padding for picture
.ascii "Oh"
.byte 0x82 ; Comma (,)
.ascii " it looks like they"
.byte 0x0A,0x1A,0x1A,0x1A,0x1A ; Newline+Standard padding for picture
.ascii "don"
.byte 0x5C ; Apostrophe (')
.ascii "t have enough stars"
.byte 0x85,0x85,0x85 ; Period (...)
.byte 0x0A,0x1A,0x1A,0x1A,0x1A ; Newline+Standard padding for picture
.ascii "At least it"
.byte 0x5C ; Apostrophe (')
.ascii "s something"
.byte 0xC2,0xC2,0xC2 ; Exclamation Mark (!)
.byte 0xFF,0 ; FF=Pause