-
Notifications
You must be signed in to change notification settings - Fork 0
/
macros.asm
72 lines (59 loc) · 1.86 KB
/
macros.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
;--------------------------------------------------------
; COPYRIGHT (C) HARRY CLARK 2024
;--------------------------------------------------------
;--------------------------------------------------------
; MOTOROLA 68K ASSEMBLER SAMPLE FILE
;--------------------------------------------------------
;-------------------------------------------------------------
; THIS FILE SERVES TO PROVIDE A BASE BY WHICH YOU ARE
; ABLE TO USE MY HOMEMADE 68K ASSEMBLER TO CREATE BIN FILES
;
; EXAMPLE OF WHICH IS THIS HELLO WORLD EXAMPLE FOR THE
; MEGA DRIVE/GENESIS
;-------------------------------------------------------------
VDP_CTRL EQU 0x00C00004
VDP_DATA EQU 0x00C00000
VDP_CRAM_WRITE EQU 0xC0000000
VDP_VRAM_WRITE EQU 0x40000000
VRAM_ADDR_TILES EQU 0x0000
VRAM_ADDR_PLANE_A EQU 0xC000
VRAM_ADDR_PLANE_B EQU 0xE000
VDP_PLANE_WIDTH EQU 0x40
VDP_PLANE_HEIGHT EQU 0x20
SEGA_TMSS_VER EQU 0x00A10001
SEGA_TMSS_ADDR EQU 0x0A14000
SEGA_TMSS_SIG EQU 'SEGA'
TEXT_POS_X EQU 0x08
TEXT_POS_Y EQU 0x04
SET_VRAM_WRITE: MACRO ADDR
MOVE.L #(VDP_VRAM_WRITE)|((\ADDR)&$3FFF)<<16|(\ADDR)>>14, VDP_CTRL
ENDM
SET_CRAM_WRITE: MACRO ADDR
MOVE.L #(VDP_CRAM_WRITE)|((\ADDR)&$3FFF)<<16|(\ADDR)>>14, VDP_CTRL
ENDM
VDP_REGISTERS:
DC.B 0x14
DC.B 0x74
DC.B 0x30
DC.B 0x00
DC.B 0x07
DC.B 0x78
DC.B 0x00
DC.B 0x00
DC.B 0x00
DC.B 0x00
DC.B 0x08
DC.B 0x00
DC.B 0x81
DC.B 0x3F
DC.B 0x00
DC.B 0x02
DC.B 0x01
DC.B 0x00
DC.B 0x00
DC.B 0xFF
DC.B 0xFF
DC.B 0x00
DC.B 0x00
DC.B 0x80
even