-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgendata.asm
88 lines (66 loc) · 1.73 KB
/
gendata.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
; ********************************************************************************************
; ********************************************************************************************
; ** Simple script to generate the room files (standalone - does not run with radyum)
.MODEL SMALL
.386
.STACK 512
; Constants
LOCALS @@
; **********************************************
; **********************************************
; ** Data here
.DATA
FILENAME db "ROOM_3.DAT"
FILEHANDLE dw 0
FILEINFO dw 4 dup (0)
; player info
PLAYER_NUMBER db 2 ; 0 to 2
ROOM_START db 32 ; 0 -> 1 / 1 -> 6 / 2 -> 32
CHAR_POS_X dw 160
CHAR_POS_Y dw 64
; **********************************************
; **********************************************
; ** CODE here
.CODE
; ** Include data files here
INCLUDE roomdata.asm
INCLUDE roominfo.asm
; **********************************************
; **********************************************
; ** Main Loop
MAIN PROC
mov ax, @DATA
mov ds, ax
; create the file
mov dx, offset FILENAME
mov ah, 3ch
xor cx, cx
int 21h
mov [FILEHANDLE], ax
; first of all, write the player info
mov ah, 40h
mov bx, [FILEHANDLE]
mov cx, 6
mov dx, offset PLAYER_NUMBER
int 21h
; now save the room data
mov ah, 40h
mov bx, [FILEHANDLE]
mov cx, 36 * 2 * 20 * 10
mov dx, offset ALL_ROOMS_DATA
int 21h
; and then the room info
mov ah, 40h
mov bx, [FILEHANDLE]
mov cx, 36 * (10 + 75)
mov dx, offset ALL_ROOMS_INFO
int 21h
; now close the file
mov bx, [FILEHANDLE]
mov ah, 3eh
int 21h
; that's all folks
mov ah, 4ch
int 21h
MAIN ENDP
END MAIN