Skip to content

Commit 24f8cd1

Browse files
authored
Merge pull request #3 from c128lib:intoinside/issue1
Intoinside/issue1
2 parents 2a3d259 + 100f6c3 commit 24f8cd1

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

lib/128spec.asm

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ upstartEnd:
333333
_stored_p: .byte 0
334334
_initial_text_color: .if (_128SPEC.change_text_color && _128SPEC.revert_to_initial_text_color) .byte 0
335335
_header: :_128spec_declare_header(_128SPEC.print_header, _128SPEC.change_character_set == "lowercase")
336+
_rowCount: .byte 0
336337

337338
.if(!_128SPEC._use_custom_result_all_failed_message) {
338339
.eval _128SPEC.set("result_all_failed_message", *)
@@ -911,6 +912,9 @@ specification:
911912

912913
.macro it(description) {
913914
.if (_128SPEC.print_example_description) {
915+
.if (!_128SPEC.write_final_results_to_file) {
916+
inc sfspec._rowCount
917+
}
914918
jmp end_text
915919
text:
916920
.if (_128SPEC.print_immediate_result) {
@@ -924,6 +928,11 @@ specification:
924928
.text " "
925929
.byte _CR
926930
.byte 0
931+
press_space:
932+
.byte _CR
933+
:_128spec_pet_text("Press SPACE to continue")
934+
.byte _CR
935+
.byte 0
927936
end_text:
928937
:_finalize_last_example()
929938
lda sfspec._description_data + 2
@@ -934,9 +943,44 @@ specification:
934943
:_set_text_color #_128SPEC.text_color
935944
:_print_string #text
936945
:_print_string #scoring
946+
947+
lda sfspec._rowCount
948+
cmp #4
949+
bne !ExitNow+
950+
:_print_string #press_space
951+
lda #0
952+
sta sfspec._rowCount
953+
954+
WaitSpacePressed()
955+
!ExitNow:
937956
}
938957
}
939958

959+
.macro WaitSpacePressed() {
960+
lda #%01111111
961+
sta MaskOnPortA
962+
lda #%00010000
963+
sta MaskOnPortB
964+
sei
965+
!Start:
966+
lda #%11111111
967+
sta $dc02
968+
lda #%00000000
969+
sta $dc03
970+
971+
lda MaskOnPortA
972+
sta $dc00
973+
lda $dc01
974+
and MaskOnPortB
975+
bne !Start-
976+
cli
977+
jmp !+
978+
979+
MaskOnPortA: .byte $00
980+
MaskOnPortB: .byte $00
981+
!:
982+
}
983+
940984
.macro _finalize_last_example() {
941985
.if (_128SPEC.print_example_description) {
942986
.if (_128SPEC.change_example_description_text_color) {

0 commit comments

Comments
 (0)