home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dream 44
/
Amiga_Dream_44.iso
/
RiscPc
/
jeux
/
biohazard.arc
/
s
/
Map
< prev
next >
Wrap
Text File
|
1995-03-26
|
12KB
|
519 lines
; Use the GET directive to include register definitions as if typed here
KEEP
GET h.WolfReg
; Use the GET directive to include a list of SWI names as if typed here
GET h.SWInames
; Area name C$$code advisable as wanted to link with C output
AREA |C$$code|, CODE, READONLY
; Export global symbols
EXPORT |PlotMap|
EXPORT |DrawNumber|
PltMapX DCB "PlotMap", 0
ALIGN
PltMapY DCD &ff000000 + PltMapY - PltMapX
;on entry
;
; r0 = pointer to data block where :-
;
; 0 = pointer to x1
; 1 = pointer to y1
; 2 = screen address (of the first line to draw on)
; 3 = pointer to map data to use as map.
; This is simply a 64x64 block of data
; 4 = x pixel increment
; 5 = y pixel increment
; 6 = x line increment
; 7 = y line increment
|PlotMap|
STMFD r13!,{r0-r12,link}
;LDMFD r13!,{r0-r12,pc}
;load up block data
MOV r14,r0
LDMIA r14,{r0-r5}
;set outer counter
MOV r12,#192<<16
Outer_Draw_Line
;set inner counter
ORR r12,r12,#192
Draw_Line
;clear registers
MOV r8,#0
MOV r9,#0
MOV r10,#0
MOV r11,#0
;check limits of x and y
CMP r0,#64<<16
BGE skip_1
CMP r0,#0
BLT skip_1
CMP r1,#64<<16
BGE skip_1
CMP r0,#0
BLT skip_1
;construct address from x & y values
MOV r6,r0,ASR #16
MOV r7,r1,ASR #16
ADD r6,r6,r7,LSL #6
;load byte from map + (x + 64(y))
LDRB r8,[r3,r6]
skip_1 ;update x & y
ADD r0,r0,r4
ADD r1,r1,r5
;load byte 2 word 1
;check limits of x and y
CMP r0,#64<<16
BGE skip_2
CMP r0,#0
BLT skip_2
CMP r1,#64<<16
BGE skip_2
CMP r0,#0
BLT skip_2
;construct address from x & y values
MOV r6,r0,ASR #16
MOV r7,r1,ASR #16
ADD r6,r6,r7,LSL #6
;load byte from map + (x + 64(y))
LDRB r9,[r3,r6]
ORR r8,r8,r9,LSL #8
skip_2 ;update x & y
ADD r0,r0,r4
ADD r1,r1,r5
;load byte 3 word 1
;check limits of x and y
CMP r0,#64<<16
BGE skip_3
CMP r0,#0
BLT skip_3
CMP r1,#64<<16
BGE skip_3
CMP r0,#0
BLT skip_3
;construct address from x & y values
MOV r6,r0,ASR #16
MOV r7,r1,ASR #16
ADD r6,r6,r7,LSL #6
;load byte from map + (x + 64(y))
LDRB r9,[r3,r6]
ORR r8,r8,r9,LSL #16
skip_3 ;update x & y
ADD r0,r0,r4
ADD r1,r1,r5
;load byte 4 word 1
;check limits of x and y
CMP r0,#64<<16
BGE skip_4
CMP r0,#0
BLT skip_4
CMP r1,#64<<16
BGE skip_4
CMP r0,#0
BLT skip_4
;construct address from x & y values
MOV r6,r0,ASR #16
MOV r7,r1,ASR #16
ADD r6,r6,r7,LSL #6
;load byte from map + (x + 64(y))
LDRB r9,[r3,r6]
ORR r8,r8,r9,LSL #24
skip_4 ;update x & y
ADD r0,r0,r4
ADD r1,r1,r5
;load byte 1 word 2
;check limits of x and y
CMP r0,#64<<16
BGE skip_5
CMP r0,#0
BLT skip_5
CMP r1,#64<<16
BGE skip_5
CMP r0,#0
BLT skip_5
;construct address from x & y values
MOV r6,r0,ASR #16
MOV r7,r1,ASR #16
ADD r6,r6,r7,LSL #6
;load byte from map + (x + 64(y))
LDRB r9,[r3,r6]
skip_5 ;update x & y
ADD r0,r0,r4
ADD r1,r1,r5
;load byte 2 word 2
;check limits of x and y
CMP r0,#64<<16
BGE skip_6
CMP r0,#0
BLT skip_6
CMP r1,#64<<16
BGE skip_6
CMP r0,#0
BLT skip_6
;construct address from x & y values
MOV r6,r0,ASR #16
MOV r7,r1,ASR #16
ADD r6,r6,r7,LSL #6
;load byte from map + (x + 64(y))
LDRB r10,[r3,r6]
ORR r9,r9,r10,LSL #8
skip_6 ;update x & y
ADD r0,r0,r4
ADD r1,r1,r5
;load byte 3 word 2
;check limits of x and y
CMP r0,#64<<16
BGE skip_7
CMP r0,#0
BLT skip_7
CMP r1,#64<<16
BGE skip_7
CMP r0,#0
BLT skip_7
;construct address from x & y values
MOV r6,r0,ASR #16
MOV r7,r1,ASR #16
ADD r6,r6,r7,LSL #6
;load byte from map + (x + 64(y))
LDRB r10,[r3,r6]
ORR r9,r9,r10,LSL #16
skip_7 ;update x & y
ADD r0,r0,r4
ADD r1,r1,r5
;load byte 4 word 2
;check limits of x and y
CMP r0,#64<<16
BGE skip_8
CMP r0,#0
BLT skip_8
CMP r1,#64<<16
BGE skip_8
CMP r0,#0
BLT skip_8
;construct address from x & y values
MOV r6,r0,ASR #16
MOV r7,r1,ASR #16
ADD r6,r6,r7,LSL #6
;load byte from map + (x + 64(y))
LDRB r10,[r3,r6]
ORR r9,r9,r10,LSL #24
skip_8 ;update x & y
ADD r0,r0,r4
ADD r1,r1,r5
;load byte 1 word 3
;check limits of x and y
CMP r0,#64<<16
BGE skip_9
CMP r0,#0
BLT skip_9
CMP r1,#64<<16
BGE skip_9
CMP r0,#0
BLT skip_9
;construct address from x & y values
MOV r6,r0,ASR #16
MOV r7,r1,ASR #16
ADD r6,r6,r7,LSL #6
;load byte from map + (x + 64(y))
LDRB r10,[r3,r6]
skip_9 ;update x & y
ADD r0,r0,r4
ADD r1,r1,r5
;load byte 2 word 3
;check limits of x and y
CMP r0,#64<<16
BGE skip_10
CMP r0,#0
BLT skip_10
CMP r1,#64<<16
BGE skip_10
CMP r0,#0
BLT skip_10
;construct address from x & y values
MOV r6,r0,ASR #16
MOV r7,r1,ASR #16
ADD r6,r6,r7,LSL #6
;load byte from map + (x + 64(y))
LDRB r11,[r3,r6]
ORR r10,r10,r11,LSL #8
skip_10 ;update x & y
ADD r0,r0,r4
ADD r1,r1,r5
;load byte 3 word 3
;check limits of x and y
CMP r0,#64<<16
BGE skip_11
CMP r0,#0
BLT skip_11
CMP r1,#64<<16
BGE skip_11
CMP r0,#0
BLT skip_11
;construct address from x & y values
MOV r6,r0,ASR #16
MOV r7,r1,ASR #16
ADD r6,r6,r7,LSL #6
;load byte from map + (x + 64(y))
LDRB r11,[r3,r6]
ORR r10,r10,r11,LSL #16
skip_11 ;update x & y
ADD r0,r0,r4
ADD r1,r1,r5
;load byte 4 word 3
;check limits of x and y
CMP r0,#64<<16
BGE skip_12
CMP r0,#0
BLT skip_12
CMP r1,#64<<16
BGE skip_12
CMP r0,#0
BLT skip_12
;construct address from x & y values
MOV r6,r0,ASR #16
MOV r7,r1,ASR #16
ADD r6,r6,r7,LSL #6
;load byte from map + (x + 64(y))
LDRB r11,[r3,r6]
ORR r10,r10,r11,LSL #24
skip_12 ;update x & y
ADD r0,r0,r4
ADD r1,r1,r5
;load byte 1 word 4
;check limits of x and y
CMP r0,#64<<16
BGE skip_13
CMP r0,#0
BLT skip_13
CMP r1,#64<<16
BGE skip_13
CMP r0,#0
BLT skip_13
;construct address from x & y values
MOV r6,r0,ASR #16
MOV r7,r1,ASR #16
ADD r6,r6,r7,LSL #6
;load byte from map + (x + 64(y))
LDRB r11,[r3,r6]
skip_13 ;update x & y
ADD r0,r0,r4
ADD r1,r1,r5
;load byte 2 word 4
;check limits of x and y
CMP r0,#64<<16
BGE skip_14
CMP r0,#0
BLT skip_14
CMP r1,#64<<16
BGE skip_14
CMP r0,#0
BLT skip_14
;construct address from x & y values
MOV r6,r0,ASR #16
MOV r7,r1,ASR #16
ADD r6,r6,r7,LSL #6
;load byte from map + (x + 64(y))
LDRB r7,[r3,r6]
ORR r11,r11,r7,LSL #8
skip_14 ;update x & y
ADD r0,r0,r4
ADD r1,r1,r5
;load byte 3 word 4
;check limits of x and y
CMP r0,#64<<16
BGE skip_15
CMP r0,#0
BLT skip_15
CMP r1,#64<<16
BGE skip_15
CMP r0,#0
BLT skip_15
;construct address from x & y values
MOV r6,r0,ASR #16
MOV r7,r1,ASR #16
ADD r6,r6,r7,LSL #6
;load byte from map + (x + 64(y))
LDRB r7,[r3,r6]
ORR r11,r11,r7,LSL #16
skip_15 ;update x & y
ADD r0,r0,r4
ADD r1,r1,r5
;load byte 4 word 4
;check limits of x and y
CMP r0,#64<<16
BGE skip_16
CMP r0,#0
BLT skip_16
CMP r1,#64<<16
BGE skip_16
CMP r0,#0
BLT skip_16
;construct address from x & y values
MOV r6,r0,ASR #16
MOV r7,r1,ASR #16
ADD r6,r6,r7,LSL #6
;load byte from map + (x + 64(y))
LDRB r7,[r3,r6]
ORR r11,r11,r7,LSL #24
skip_16 ;update x & y
ADD r0,r0,r4
ADD r1,r1,r5
;store on screen
STMIA r2!,{r8-r11}
;update inner counter
SUB r12,r12,#16
MOVS r6,r12,LSL #16
BNE Draw_Line
;update line start coordinates
;load original points from last line
LDMIA r14,{r0,r1}
;load line increments
LDR r6,[r14,#24]
LDR r7,[r14,#28]
ADD r0,r0,r6
ADD r1,r1,r7
STMIA r14,{r0,r1}
;update screen start for next line
ADD r2,r2,#128
;update inner counter
SUB r12,r12,#1<<16
MOVS r6,r12,LSR #16
BNE Outer_Draw_Line
EndPlotMap
LDMFD r13!,{r0-r12,pc}
;on entry
;
; r0 = screen address
; r1 = Number to draw (1..4)
; r2 = pointer to number graphics data
|DrawNumber|
STMFD r13!,{r0-r6,link}
;modify number pointer to point to correct number
SUB r1,r1,#1
;multiply number by 20x16.
MOV r1,r1,LSL #4
MOV r3,r1,LSL #4
ADD r1,r3,r1,LSL #2
ADD r2,r2,r1
;plot number on screen
MOV r1,#20
NumberLoop
LDMIA r2!,{r3-r6}
STMIA r0,{r3-r6}
ADD r0,r0,#320
SUBS r1,r1,#1
BNE NumberLoop
EndDrawNumber
LDMFD r13!,{r0-r6,pc}
END