Skip to content

Commit 6d61cb8

Browse files
committedMay 2, 2021
Move FarPtr to base.inc
I want to use it in some files that don't depend on the game struct.
1 parent 3d7832c commit 6d61cb8

File tree

5 files changed

+21
-15
lines changed

5 files changed

+21
-15
lines changed
 

‎Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ seg6.obj: constants.asm structs.asm variables.asm
7373
sound.obj: constants.asm variables.asm func.mac
7474
digits.obj: variables.asm func.mac
7575

76-
$(OBJ): extern.inc windows.inc
76+
$(OBJ): base.inc extern.inc windows.inc
7777

7878
variables.asm: data.bin genvars.sh Makefile
7979
$(SHELL) genvars.sh >variables.asm

‎base.inc

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
; base.inc - common definitions
2+
3+
; Useful constants for dealing with far pointers.
4+
;
5+
; Declare far pointers as a dword and use these constants to access
6+
; the segment and offset parts.
7+
;
8+
; mov bx,[GameStatePtr]
9+
; mov dx,[bx+TrapListPtr+FarPtr.Off]
10+
; mov ax,[bx+TrapListPtr+FarPtr.Seg]
11+
;
12+
13+
STRUC FarPtr
14+
.Off resw 1 ; 0x0
15+
.Seg resw 1 ; 0x2
16+
ENDSTRUC
17+
18+
; vim: syntax=nasm

‎logic.asm

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ SEGMENT CODE ; 3
22

33
; Game logic
44

5+
%include "base.inc"
56
%include "constants.asm"
67
%include "structs.asm"
78
%include "variables.asm"

‎seg4.asm

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ SEGMENT CODE ; 4
22

33
; Functions for loading levels
44

5+
%include "base.inc"
56
%include "constants.asm"
67
%include "structs.asm"
78
%include "variables.asm"

‎structs.asm

-14
Original file line numberDiff line numberDiff line change
@@ -148,18 +148,4 @@ STRUC Slipper
148148
.isblock resw 1 ; 0x9
149149
ENDSTRUC
150150

151-
; Useful constants for dealing with far pointers.
152-
;
153-
; Declare far pointers as a dword and use these constants to access
154-
; the segment and offset parts.
155-
;
156-
; mov bx,[GameStatePtr]
157-
; mov dx,[bx+TrapListPtr+FarPtr.Off]
158-
; mov ax,[bx+TrapListPtr+FarPtr.Seg]
159-
;
160-
STRUC FarPtr
161-
.Off resw 1 ; 0x0
162-
.Seg resw 1 ; 0x2
163-
ENDSTRUC
164-
165151
; vim: syntax=nasm

0 commit comments

Comments
 (0)
Please sign in to comment.