-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgameFinancesIncome.asm
322 lines (289 loc) · 7.02 KB
/
gameFinancesIncome.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
#importonce
gameFinancesCalcTotalIncome:
// Alles aufsummieren
add32 currentSlotMachines : currentTotalIncome : currentTotalIncome
add32 currentProstitutes : currentTotalIncome : currentTotalIncome
add32 currentBars : currentTotalIncome : currentTotalIncome
add32 currentBetting : currentTotalIncome : currentTotalIncome
add32 currentGambling : currentTotalIncome : currentTotalIncome
add32 currentBrothels : currentTotalIncome : currentTotalIncome
add32 currentHotels : currentTotalIncome : currentTotalIncome
rts
gameFinancesCalcSlotMachines:
// Automaten
ldx currentPlayerNumber // Spielernummer
lda playerSlotMachines,x // Anzahl der Automaten
tax
!loop:
getRandomRange16 #$0064 : #$044c // 100-1100$ Gewinn
add16To32 rnd16_result : currentSlotMachines: currentSlotMachines // für die Aufstellung sichern
dex
bne !loop-
rts
gameFinancesCalcProstitutes:
// Prostituierte
ldx currentPlayerNumber // Spielernummer
lda playerProstitutes,x
tax
!loop:
getRandomRange16 #$0320 : #$0af0 // 800-2800$ Gewinn
add16To32 rnd16_result : currentProstitutes: currentProstitutes // für die Aufstellung sichern
dex
bne !loop-
rts
gameFinancesCalcBars:
// Bars
ldx currentPlayerNumber // Spielernummer
lda playerBars,x
tax
!loop:
getRandomRange16 #$2710 : #$4e20 // 10.000-20.000$ Gewinn
add16To32 rnd16_result : currentBars: currentBars // für die Aufstellung sichern
dex
bne !loop-
rts
gameFinancesCalcBetting:
// Wettbüro
ldx currentPlayerNumber // Spielernummer
lda playerBetting,x
tax
!loop:
getRandomRange16 #$2710 : #$88b8 // 10.000-35.000$ Gewinn
add16To32 rnd16_result : currentBetting: currentBetting // für die Aufstellung sichern
dex
bne !loop-
rts
gameFinancesCalcGambling:
// Spielsalon
ldx currentPlayerNumber // Spielernummer
lda playerGambling,x
tax
!loop:
getRandomRange16 #$3a98 : #$afc8 // 15.000-45.000$ Gewinn
add16To32 rnd16_result : currentGambling: currentGambling // für die Aufstellung sichern
dex
bne !loop-
rts
gameFinancesCalcBrothels:
// Bordell
ldx currentPlayerNumber // Spielernummer
lda playerBrothels,x
tax
!loop:
getRandomRange16 #$4e20 : #$fde8 // 20.000-65.000$ Gewinn
add16To32 rnd16_result : currentBrothels: currentBrothels // für die Aufstellung sichern
dex
bne !loop-
rts
gameFinancesCalcHotels:
// Hotels
ldx currentPlayerNumber // Spielernummer
lda playerHotels,x
tax
!loop:
getRandomRange16 #$88b8 : #$fde8 // 35.000-65.000$ Gewinn
add16To32 rnd16_result : currentHotels: currentHotels // für die Aufstellung sichern
dex
bne !loop-
rts
//===============================================================================
// gameFinancesShowIncome
//
// Zeigt das Einkommen
//===============================================================================
gameFinancesShowIncome:
mov16 #strFinancesTitle : TextPtr // Text: "Finanzen:"
jsr Print_text
// Spielernamen anzeigen
ldy currentPlayerOffset_16 // Offset für Spielernamen 16 Byte
mov16 #playerNames : TextPtr
jsr Print_text_offset // Schreibe den Spielernamen
lda #','
jsr BSOUT
lda #PET_CR // Zeilenumbruch
jsr BSOUT
mov16 #strFinancesIncome : TextPtr // Text: "Ihre Einnahmen sind:"
jsr Print_text
// Spielautomaten:
ldx currentPlayerNumber
mov playerSlotMachines, x : hex8dec_value
cmp #0
beq !skip+
jsr Print_hex8_dec
plot_get
ldy #4
plot_set
lda #'X'
jsr BSOUT
mov16 #strFinancesSlotMachines : TextPtr
jsr Print_text
plot_get
ldy #25
plot_set
lda #'$'
jsr BSOUT
jsr gameFinancesCalcSlotMachines
mov32 currentSlotMachines : hex32dec_value
jsr Print_hex32_dec
lda #PET_CR
jsr BSOUT
!skip:
// Prostituierte
ldx currentPlayerNumber
mov playerProstitutes, x : hex8dec_value
cmp #0
beq !skip+
jsr Print_hex8_dec
plot_get
ldy #4
plot_set
lda #'X'
jsr BSOUT
mov16 #strFinancesProstitutes : TextPtr
jsr Print_text
plot_get
ldy #25
plot_set
lda #'$'
jsr BSOUT
jsr gameFinancesCalcProstitutes
mov32 currentProstitutes : hex32dec_value
jsr Print_hex32_dec
lda #PET_CR
jsr BSOUT
!skip:
// Bars
ldx currentPlayerNumber
mov playerBars, x : hex8dec_value
cmp #0
beq !skip+
jsr Print_hex8_dec
plot_get
ldy #4
plot_set
lda #'X'
jsr BSOUT
mov16 #strFinancesBars : TextPtr
jsr Print_text
plot_get
ldy #25
plot_set
lda #'$'
jsr BSOUT
jsr gameFinancesCalcBars
mov32 currentBars : hex32dec_value
jsr Print_hex32_dec
lda #PET_CR
jsr BSOUT
!skip:
// Wettbüro
ldx currentPlayerNumber
mov playerBetting, x : hex8dec_value
cmp #0
beq !skip+
jsr Print_hex8_dec
plot_get
ldy #4
plot_set
lda #'X'
jsr BSOUT
mov16 #strFinancesBetting : TextPtr
jsr Print_text
plot_get
ldy #25
plot_set
lda #'$'
jsr BSOUT
jsr gameFinancesCalcBetting
mov32 currentBetting : hex32dec_value
jsr Print_hex32_dec
lda #PET_CR
jsr BSOUT
!skip:
// Spielsalon
ldx currentPlayerNumber
mov playerGambling, x : hex8dec_value
cmp #0
beq !skip+
jsr Print_hex8_dec
plot_get
ldy #4
plot_set
lda #'X'
jsr BSOUT
mov16 #strFinancesGambling : TextPtr
jsr Print_text
plot_get
ldy #25
plot_set
lda #'$'
jsr BSOUT
jsr gameFinancesCalcGambling
mov32 currentGambling : hex32dec_value
jsr Print_hex32_dec
lda #PET_CR
jsr BSOUT
!skip:
// Bordell
ldx currentPlayerNumber
mov playerBrothels, x : hex8dec_value
cmp #0
beq !skip+
jsr Print_hex8_dec
plot_get
ldy #4
plot_set
lda #'X'
jsr BSOUT
mov16 #strFinancesBrothels : TextPtr
jsr Print_text
plot_get
ldy #25
plot_set
lda #'$'
jsr BSOUT
jsr gameFinancesCalcBrothels
mov32 currentBrothels : hex32dec_value
jsr Print_hex32_dec
lda #PET_CR
jsr BSOUT
!skip:
// Hotel
ldx currentPlayerNumber
mov playerHotels, x : hex8dec_value
cmp #0
beq !skip+
jsr Print_hex8_dec
plot_get
ldy #4
plot_set
lda #'X'
jsr BSOUT
mov16 #strFinancesHotels : TextPtr
jsr Print_text
plot_get
ldy #25
plot_set
lda #'$'
jsr BSOUT
jsr gameFinancesCalcHotels
mov32 currentHotels : hex32dec_value
jsr Print_hex32_dec
lda #PET_CR
jsr BSOUT
!skip:
mov16 #strLine40 : TextPtr // Line
jsr Print_text
jsr gameFinancesCalcTotalIncome // Gesamteinkommen berechnen
mov16 #strTotal : TextPtr // Text: Gesamt
jsr Print_text
plot_get
ldy #25
plot_set
lda #'$'
jsr BSOUT
mov32 currentTotalIncome : hex32dec_value
jsr Print_hex32_dec
lda #PET_CR
jsr BSOUT
rts