At 0xE961 write the number of minutes.

It's one byte so it can't be more than 255.

At 0xE941 write the time given in ticks (2 bytes), i.e. the number of minutes multiplied by the ticks in a minute.

Convert minutes to 3-digit BCD instead of 2-digit semi-BCD.

At 0xE962 write: 20 30 FF

At 0xFF30 write: DA C3 01 90 02 A3 01 49 FF 38 63 01 A2 00 38 E9 64 90 03 E8 80 F8 18 69 64 8E 2A 05 A2 00 38 E9 0A 90 03 E8 80 F8 18 69 0A 48 8A 0A 0A 0A 0A 18 63 01 FA FA 60

Display 3-digit minutes correctly in the pause menu.

At 0x16335 write: 4C 50 FF

At 0x17F50 write: AC 2A 05 C9 A0 90 03 88 A9 99 48 98 F0 05 18 69 30 95 00 68 4C 42 E3

Decrease minutes by one correctly when minutes = 100, 200.

At 0x16313 write: 20 40 FF

At 0x17F40 write: AD 27 05 0D 2A 05 60

Display 3-digit minutes correctly in pop-up messages.

At 0xC9BF write: AE 2A 05 48 8A 18 69 30 8D 56 08 68 EA EA EA EA

Trim leading zeroes (instead of spaces).

At 0xC9FD write 30.

Show seconds only if 1 minute is left (not 101, 201).

At 0xC9A6, 0xC9DE, 0xE319 write: 20 20 FF EA EA

At 0xFF20 write: AD 2A 05 D0 06 AD 27 05 C9 02 60 AD 27 05 38 60

Don't think it's "TIME UP" if only the last 2 digits of the minutes are zero.

At 0x8442, 0x8686, 0xC98E, 0xEF80, 0xF00F, 0xF3D6, 0xF7CC write: 20 10 FF

At 0xFF10 write: AD 27 05 0D 2A 05 60

Details:

Code: Select all

```
You might have noticed that most assembly listings here look rather different than the older ones.
That's because I made those hacks using an assembler instead of hand-assembling, and the listing output of the assembler looks like this.
Convert minutes to 3-digit BCD instead of 2-digit semi-BCD.
start address $01FF30
1 01FF30 .ORG $01FF30
2 01FF30
3 01FF30 ; convert minutes to 3-digit BCD instead of 2-digit semi-BCD
4 01FF30
memory 8-bit
5 01FF30 .MEM 8
index 8-bit
6 01FF30 .INDEX 8
7 01FF30
8 01FF30 DA PHX
9 01FF31 C3 01 CMP $01,S
10 01FF33 90 02 BCC Z
11 01FF35 A3 01 LDA $01,S
12 01FF37 Z
13 01FF37 49 FF EOR #$FF
14 01FF39 38 SEC
15 01FF3A 63 01 ADC $01,S
16 01FF3C
17 01FF3C A2 00 LDX #$00
18 01FF3E LOOP_HUNDREDS
19 01FF3E 38 SEC
20 01FF3F E9 64 SBC #100
21 01FF41 90 03 BCC END_HUNDREDS
22 01FF43 E8 INX
23 01FF44 80 F8 BRA LOOP_HUNDREDS
24 01FF46
25 01FF46 END_HUNDREDS
26 01FF46 18 CLC
27 01FF47 69 64 ADC #100
28 01FF49
29 01FF49 8E 2A 05 STX $052A ; remaining min hundreds
30 01FF4C
31 01FF4C A2 00 LDX #$00
32 01FF4E LOOP_TENS
33 01FF4E 38 SEC
34 01FF4F E9 0A SBC #10
35 01FF51 90 03 BCC END_TENS
36 01FF53 E8 INX
37 01FF54 80 F8 BRA LOOP_TENS
38 01FF56
39 01FF56 END_TENS
40 01FF56 18 CLC
41 01FF57 69 0A ADC #10
42 01FF59
43 01FF59 48 PHA
44 01FF5A 8A TXA
45 01FF5B 0A ASL
46 01FF5C 0A ASL
47 01FF5D 0A ASL
48 01FF5E 0A ASL
49 01FF5F 18 CLC
50 01FF60 63 01 ADC $01,S
51 01FF62 FA PLX
52 01FF63 FA PLX
53 01FF64
54 01FF64 60 RTS
Display 3-digit minutes correctly in the pause menu.
start address $02FF50
1 02FF50 .ORG $02FF50
optimize addresses enabled
2 02FF50 .OPTIMIZE ON
3 02FF50
4 02FF50 ; display 3-digit minutes correctly in pause menu
5 02FF50
memory 8-bit
6 02FF50 .MEM 8
index 8-bit
7 02FF50 .INDEX 8
8 02FF50
9 02FF50 ; Remaining min was just decreased.
10 02FF50 ; Decrease hundreds if there was borrow.
11 02FF50
12 02FF50 AC 2A 05 LDY $052A ; remaining min hundreds
13 02FF53 C9 A0 CMP #$A0
14 02FF55 90 03 BLT @1
15 02FF57 88 DEY
16 02FF58 A9 99 LDA #$99
17 02FF5A @1
18 02FF5A
19 02FF5A 48 PHA
20 02FF5B 98 TYA ; remaining min hundreds
21 02FF5C F0 05 BEQ SKIP
22 02FF5E 18 CLC
23 02FF5F 69 30 ADC #'0'
24 02FF61 95 00 STA $00,X
25 02FF63 SKIP
26 02FF63 68 PLA
27 02FF64 4C 42 E3 JMP $02E342
Decrease minutes by one correctly when minutes = 100, 200.
Original code at 02:E313 = 0x16313:
02:E313: ad 27 05 LDA $0527 ; remaining min ; <-- overwrite with JSR $FF40
02:E316: f0 0e BEQ $e326
At 02:FF40 = 0x17F40 write:
AD 27 05 LDA $0527 ; remaining min
0D 2A 05 ORA $052A ; remaining min hundreds
60 RTS
Display 3-digit minutes correctly in pop-up messages.
start address $01C9BF
1 01C9BF .ORG $01C9BF
2 01C9BF
3 01C9BF ; display 3-digit minutes correctly in pop-up messages
4 01C9BF
memory 8-bit
5 01C9BF .MEM 8
index 8-bit
6 01C9BF .INDEX 8
7 01C9BF
8 01C9BF AE 2A 05 LDX $052A ; remaining min hundreds
9 01C9C2 48 PHA
10 01C9C3 8A TXA
11 01C9C4 18 CLC
12 01C9C5 69 30 ADC #'0'
13 01C9C7 8D 56 08 STA $0856 ; buffer for strings
14 01C9CA 68 PLA
15 01C9CB EA NOP
16 01C9CC EA NOP
17 01C9CD EA NOP
18 01C9CE EA NOP
19 01C9CF ; 01:C9CF
Show seconds only if 1 minute is left (not 101, 201).
start address $01FF20
1 01FF20 .ORG $01FF20
2 01FF20
3 01FF20 ; Show seconds only if 1 minute is left (not 101, 201).
4 01FF20
memory 8-bit
5 01FF20 .MEM 8
index 8-bit
6 01FF20 .INDEX 8
7 01FF20
8 01FF20 AD 2A 05 LDA $052A ; remaining min hundreds
9 01FF23 D0 06 BNE @1
10 01FF25 AD 27 05 LDA $0527 ; remaining min
11 01FF28 C9 02 CMP #$02
12 01FF2A 60 RTS
13 01FF2B @1
14 01FF2B AD 27 05 LDA $0527 ; remaining min
15 01FF2E 38 SEC
16 01FF2F 60 RTS
Don't think it's "TIME UP" if only the last 2 digits of the minutes are zero.
At 0x8442 etc. is this code:
01:8442: ad 27 05 LDA $0527 ; remaining min ; <-- overwrite with JSR $FF10
01:8445: 0d 29 05 ORA $0529 ; remaining sec
At 0xFF10 write:
AD 27 05 LDA $0527 ; remaining min
0D 2A 05 ORA $052A ; remaining min hundreds
60 RTS
```