-
Notifications
You must be signed in to change notification settings - Fork 1
/
iolibv3test.asm
101 lines (95 loc) · 1.33 KB
/
iolibv3test.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
#import "plus4_basic_header.inc"
#import "plus4_io_map.inc"
#import "ted.inc"
#import "plus4_kernal_table.inc"
.encoding "petscii_mixed"
jsr primm
.text "IOLibV3 test by Siz (c) 2014.06.03"
.byte 14, 13, 0
jsr iolib.detect
lda iolib.drivedetect.io_drivetyp
bne !+
rts
!: jsr iolib.init
jsr primm
.byte 13
.text "Testing loader: "
.byte 0
sei
lda #<irq
ldx #>irq
sta $fffe
stx $ffff
lda #%00000010
sta ted.irqmask
lda #220
sta ted.rasterirqline
sta ted.ramen
lda #0
sta counter
sta counter+1
sta counter+2
sta counter+3
cli
ldx #'t'
ldy #'e'
jsr iolib.load
php
ldx #0
ldy #0
jsr iolib.load
lda #%00000010
sta ted.irqmask
lda $efff
sta ted.romen
tax
lda #0
jsr lnprt
jsr iolib.prtspc
plp
bcs !+
jsr primm
.text "no "
.byte 0
!: jsr primm
.text "error"
.byte 13
.text "load took "
.byte 0
lda counter
ldx counter+1
jsr lnprt
lda #':'
jsr chrout
lda counter+2
ldx counter+3
jsr lnprt
jsr primm
.text " frames"
.byte 13, 0
rts
irq: inc ted.border
pha
lda ted.irqsource
sta ted.irqsource
inc counter+3
bne !+
inc counter+2
bne !+
inc counter+1
bne !+
inc counter
!: pla
dec ted.border
rti
counter:
.word 0
.word 0
.namespace iolib {
#define prtstatus
#define need_video_detect
#define need_memory_detect
#define need_sound_detect
#define need_loader
}
#import "iolib.inc"