~ubuntu-branches/ubuntu/karmic/zsnes/karmic

« back to all changes in this revision

Viewing changes to src/chips/st11proc.asm

  • Committer: Bazaar Package Importer
  • Author(s): Joshua Kwan
  • Date: 2007-06-04 21:46:47 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070604214647-j5zowa8vplkug0yj
Tags: 1.510-1
* New upstream release - all patches merged. closes: #380734, #419270
* Add a .desktop file, thanks Nicholas Wheeler. closes: #367942
* Include a ton of documentation that ships with the tarball.
  closes: #392143 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
;Copyright (C) 1997-2007 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach )
 
2
;
 
3
;http://www.zsnes.com
 
4
;http://sourceforge.net/projects/zsnes
 
5
;https://zsnes.bountysource.com
 
6
;
 
7
;This program is free software; you can redistribute it and/or
 
8
;modify it under the terms of the GNU General Public License
 
9
;version 2 as published by the Free Software Foundation.
 
10
;
 
11
;This program is distributed in the hope that it will be useful,
 
12
;but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
;GNU General Public License for more details.
 
15
;
 
16
;You should have received a copy of the GNU General Public License
 
17
;along with this program; if not, write to the Free Software
 
18
;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
19
 
 
20
%include "macros.mac"
 
21
 
 
22
EXTSYM seta11_address,seta11_byte,setaramdata,ST011_DR
 
23
EXTSYM ST011_MapR_60,ST011_MapW_60,ST011_MapW_68;ST011_MapR_68
 
24
 
 
25
SECTION .text
 
26
 
 
27
 
 
28
NEWSYM Seta11Read8_68
 
29
    mov ebx,[setaramdata]
 
30
    and ecx,0fffh
 
31
    mov al,[ebx+ecx]
 
32
    mov [ST011_DR],al
 
33
    xor ebx,ebx
 
34
    ret
 
35
 
 
36
NEWSYM Seta11Write8_68
 
37
    test ecx,8000h
 
38
    jnz .nosetenablew8 ; ignore ROM writes
 
39
    mov [seta11_address],cx
 
40
    mov [seta11_byte],al
 
41
    pushad
 
42
    call ST011_MapW_68
 
43
    popad
 
44
.nosetenablew8
 
45
    ret
 
46
 
 
47
NEWSYM Seta11Read16_68
 
48
    mov ebx,[setaramdata]
 
49
    and ecx,0fffh
 
50
    mov ax,[ebx+ecx]
 
51
    mov [ST011_DR],ah
 
52
    xor ebx,ebx
 
53
    ret
 
54
 
 
55
NEWSYM Seta11Write16_68
 
56
    test ecx,8000h
 
57
    jnz .nosetenablew16 ; ignore ROM writes
 
58
    mov [seta11_address],cx
 
59
    mov [seta11_byte],al
 
60
    mov [seta11temp],ah
 
61
    pushad
 
62
    call ST011_MapW_68
 
63
    mov ah,[seta11temp]
 
64
    mov [seta11_byte],ah
 
65
    inc word[seta11_address]
 
66
    call ST011_MapW_68
 
67
    popad
 
68
.nosetenablew16
 
69
    ret
 
70
 
 
71
 
 
72
NEWSYM Seta11Read8_60
 
73
    xor al,al
 
74
    cmp ecx,4000h
 
75
    jae .nosetenabler8
 
76
    and ecx,3
 
77
    mov [seta11_address],cx
 
78
    pushad
 
79
    call ST011_MapR_60
 
80
    popad
 
81
    mov al,[seta11_byte]
 
82
 .nosetenabler8
 
83
    ret
 
84
 
 
85
NEWSYM Seta11Write8_60
 
86
    cmp ecx,4000h
 
87
    jae .nosetenablew8
 
88
    and ecx,3
 
89
    mov [seta11_address],cx
 
90
    mov [seta11_byte],al
 
91
    pushad
 
92
    call ST011_MapW_60
 
93
    popad
 
94
.nosetenablew8
 
95
    ret
 
96
 
 
97
NEWSYM Seta11Read16_60
 
98
    xor ax,ax
 
99
    cmp ecx,4000h
 
100
    jae .nosetenabler16
 
101
    and ecx,3
 
102
    mov [seta11_address],cx
 
103
    pushad
 
104
    call ST011_MapR_60
 
105
    mov al,[seta11_byte]
 
106
    mov [seta11temp],al
 
107
    inc word[seta11_address]
 
108
    and word[seta11_address],3
 
109
    call ST011_MapR_60
 
110
    popad
 
111
    mov al,[seta11temp]
 
112
    mov ah,[seta11_byte]
 
113
.nosetenabler16
 
114
    ret
 
115
 
 
116
NEWSYM Seta11Write16_60
 
117
    cmp ecx,4000h
 
118
    jae .nosetenablew16
 
119
    and ecx,3
 
120
    mov [seta11_address],cx
 
121
    mov [seta11_byte],al
 
122
    mov [seta11temp],ah
 
123
    pushad
 
124
    call ST011_MapW_60
 
125
    mov ah,[seta11temp]
 
126
    mov [seta11_byte],ah
 
127
    inc word[seta11_address]
 
128
    and word[seta11_address],3
 
129
    call ST011_MapW_60
 
130
    popad
 
131
.nosetenablew16
 
132
    ret
 
133
 
 
134
 
 
135
SECTION .bss
 
136
NEWSYM seta11temp, resb 1