-
Notifications
You must be signed in to change notification settings - Fork 0
/
array_test.asm
69 lines (58 loc) · 1.5 KB
/
array_test.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
#import "libs/arrays.asm"
* = $c000
TestArray: AllocateArray(100, 32)
// GuardArray(TestArray.pre, TestArray.post)
TestArray2: AllocateArray(100, 32)
// GuardArray(TestArray2.pre, TestArray2.post)
BasicUpstart2(Entry)
Entry:
// "accidentally" over write pre buffer data. debugger should freeze.
lda #0
sta TestArray.pre
ldx #8
ldy #2
ArrayIndexYX($02, ScreenRamLSB, ScreenRamMSB)
ArrayIndexYX($04, ColorRamLSB, ColorRamMSB)
lda #$23
sta ($02), y
lda #RED
sta ($04), y
ldx #5
ldy #12
ArrayIndexYX($02, ScreenRamLSB, ScreenRamMSB)
ArrayIndexYX($04, ColorRamLSB, ColorRamMSB)
lda #$44
sta ($02), y
lda #GREEN
sta ($04), y
ldx #5
ldy #10
ArrayFillRow($02, ScreenRamLSB, ScreenRamMSB, 40, 23)
ldx #5
ldy #20
ArrayCopyRow($02, ScreenRamLSB, ScreenRamMSB, $04, 40)
ldx #12
ArrayCopyIntoRow($02, ScreenRamLSB, ScreenRamMSB, TestRowData, 40)
// self mod should break when GuardRange() is active!
lda #4
sta BREAK + 1
BREAK:
ldx #4
ArrayCopyIntoRow($02, ScreenRamLSB, ScreenRamMSB, TestRowData, 40)
!:
ArrayFindRow($02, ScreenRamLSB, ScreenRamMSB, 32, 30, 25)
lda #$46
sta ($02), y
jmp !-
__Entry:
GuardRange(Entry, __Entry)
* = $3000
ScreenRamLSB: MakeArrayLookupsLSB($0400, 40, 25)
ScreenRamMSB: MakeArrayLookupsMSB($0400, 40, 25)
ColorRamLSB: MakeArrayLookupsLSB($d800, 40, 25)
ColorRamMSB: MakeArrayLookupsMSB($d800, 40, 25)
TestRowData:
.text "Hello there from Furroys Test Data!!!"
.text " "
//* = $0400 "Screen Ram"
//ScreenRam: AllocateArray(1000, 32)