-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathsram.s
69 lines (63 loc) · 1.86 KB
/
sram.s
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
/*
* Copyright (c) 2011 Emmanuel Vadot <elbarto@neogeodev.org>
* Copyright (c) 2011 Furrtek <furrtek@neogeodev.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: sram.s,v 1.3 2011/11/15 18:24:52 furrtek Exp $ */
.include "defines.inc"
.global test_sram
test_sram:
movea.l #0xD00010, a0
lea str_backupramok, a1
move.l #0xF, d0
1:
cmp.b (a0)+, (a1)+
bne init_sram | If string isn't here, backupram must be init
dbra d0, 1b
movea.l #0xD00000, a0
lea str_neopenbiosok, a1
move.l #0xF, d0
1:
cmp.b (a0)+, (a1)+
bne init_sram | Not a neopenbios compliant backupram
dbra d0, 1b
rts
init_sram:
move.b #0, (REG_SRAMUNLOCK)
movea.l #0xD00000, a0
lea str_neopenbiosok, a1
move.l #0x1E, d0
1:
move.b (a1)+, (a0)+
dbra d0, 1b
move.w #0x7FFF, (SRAM_FIRSTCOLOR)
move.w #0x7888, (SRAM_SECONDCOLOR)
move.w #0x4F00, (SRAM_THIRDCOLOR)
move.b #0, (SRAM_LOGOCOLOR)
lea SRAM_CUSTOMMESSAGE, a0
lea str_defaultmessage, a1
move.l #0x10-1, d0
1:
move.b (a1)+, (a0)+
dbra d0, 1b
move.b #0, (REG_SRAMLOCK)
rts
.section .rodata
.align 4
str_neopenbiosok:
.string "NEOPENBIOS v0.1"
str_backupramok:
.string "BACKUP RAM OK!\x80"
str_defaultmessage:
.string "I love NeoGeo "