mirror of
https://github.com/Pecusx/libretro-atari800.git
synced 2026-05-21 14:49:36 +02:00
initial commit
This commit is contained in:
@@ -0,0 +1,225 @@
|
||||
| c2p_uni.S - Atari Falcon chunky to planar conversion
|
||||
|
|
||||
| Copyright (c) 1996 Douglas Little
|
||||
| Copyright (c) 1997-1998 Petr Stehlik and Karel Rous
|
||||
| Copyright (c) 1998-2008 Atari800 development team (see DOC/CREDITS)
|
||||
|
|
||||
| This file is part of the Atari800 emulator project which emulates
|
||||
| the Atari 400, 800, 800XL, 130XE, and 5200 8-bit computers.
|
||||
|
|
||||
| Atari800 is free software; you can redistribute it and/or modify
|
||||
| it under the terms of the GNU General Public License as published by
|
||||
| the Free Software Foundation; either version 2 of the License, or
|
||||
| (at your option) any later version.
|
||||
|
|
||||
| Atari800 is distributed in the hope that it will be useful,
|
||||
| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
| GNU General Public License for more details.
|
||||
|
|
||||
| You should have received a copy of the GNU General Public License
|
||||
| along with Atari800; if not, write to the Free Software
|
||||
| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
*-------------------------------------------------------*
|
||||
|
||||
*-------------------------------------------------------*
|
||||
|
||||
*-------------------------------------------------------*
|
||||
* Initialisation functions *
|
||||
*-------------------------------------------------------*
|
||||
|
||||
.globl _screenw,_screenh
|
||||
.globl _vramw,_vramh
|
||||
.globl _odkud,_kam
|
||||
|
||||
*-------------------------------------------------------*
|
||||
* General functions *
|
||||
*-------------------------------------------------------*
|
||||
|
||||
.globl _rplanes
|
||||
|
||||
*-------------------------------------------------------*
|
||||
.include "falcon/c2pmac.S"
|
||||
*-------------------------------------------------------*
|
||||
|
||||
*-------------------------------------------------------*
|
||||
* Initialise rendering display *
|
||||
*-------------------------------------------------------*
|
||||
_rplanes:
|
||||
*-------------------------------------------------------*
|
||||
movem.l d0-a6,-(sp)
|
||||
*-------------------------------------------------------*
|
||||
|
||||
*-------------------------------------------------------*
|
||||
| .set rplanes_local_regs,0+0
|
||||
*-------------------------------------------------------*
|
||||
| .set rplanes_local_rts,0+60
|
||||
*-------------------------------------------------------*
|
||||
move.l _odkud,a0
|
||||
move.l _kam,a1
|
||||
|
||||
| centering of view at screen
|
||||
move.w #384,d0 | width of Atari800 emulated screen
|
||||
sub.w _screenw,d0 | width of displayed screen
|
||||
move.w d0,src_line_offset
|
||||
lsr.w #1,d0 | centering
|
||||
lea (a0,d0.w),a0 | offset 24 or 32 pixels
|
||||
|
||||
| centering of screen in videoram in horizontal axis
|
||||
move.w _vramw,d0
|
||||
sub.w _screenw,d0
|
||||
move.w d0,dst_line_offset
|
||||
lsr.w #1,d0
|
||||
neg.w d0
|
||||
lea (a1,d0.w),a1 | negative pre-offset (will be OK at rplanes_ylp)
|
||||
|
||||
| centering of screen in videoram in vertical axis
|
||||
move.w _vramh,d0
|
||||
sub.w _screenh,d0
|
||||
lsr.w #1,d0
|
||||
move.w _vramw,d1
|
||||
mulu d1,d0
|
||||
lea (a1,d0.l),a1
|
||||
|
||||
| precompute line width in long words
|
||||
move.w _screenw,d0
|
||||
lsr.w #4,d0
|
||||
subq.w #1,d0
|
||||
move.w d0,line_long_width
|
||||
|
||||
*-------------------------------------------------------*
|
||||
movem.l (a0)+,d1-d4
|
||||
*-------------------------------------------------------*
|
||||
move.l #0x00FF00FF,d0 | 4
|
||||
splice 8 d1 d3 d0 d7 | 18
|
||||
splice 8 d2 d4 d0 d7 | 18
|
||||
*-------------------------------------------------------*
|
||||
move.l #0x0F0F0F0F,d0 | 4
|
||||
splice 4 d1 d2 d0 d7 | 18
|
||||
splice 4 d3 d4 d0 d7 | 18
|
||||
*-------------------------------------------------------*
|
||||
swap d2 | 4(4:0)
|
||||
swap d4 | 4(4:0)
|
||||
eor.w d1,d2 | 2(2:0)
|
||||
eor.w d3,d4 | 2(2:0)
|
||||
eor.w d2,d1 | 2(2:0)
|
||||
eor.w d4,d3 | 2(2:0)
|
||||
eor.w d1,d2 | 2(2:0)
|
||||
eor.w d3,d4 | 2(2:0)
|
||||
swap d2 | 4(4:0)
|
||||
swap d4 | 4(4:0)
|
||||
*-------------------------------------------------------*
|
||||
move.l #0x33333333,d0 | 4
|
||||
splice 2 d1 d2 d0 d7 | 18
|
||||
splice 2 d3 d4 d0 d7 | 18
|
||||
*-------------------------------------------------------*
|
||||
move.l #0x55555555,d0 | 4
|
||||
splice 1 d1 d3 d0 d7 | 18
|
||||
splice 1 d2 d4 d0 d7 | 18
|
||||
*-------------------------------------------------------*
|
||||
* 32-bit destination *
|
||||
*-------------------------------------------------------*
|
||||
swap d4 | 4(4:0)
|
||||
eor.w d2,d4 | 2(2:0)
|
||||
eor.w d4,d2 | 2(2:0)
|
||||
eor.w d2,d4 | 2(2:0)
|
||||
swap d2 | 4(4:0)
|
||||
swap d3 | 4(4:0)
|
||||
eor.w d1,d3 | 2(2:0)
|
||||
eor.w d3,d1 | 2(2:0)
|
||||
eor.w d1,d3 | 2(2:0)
|
||||
swap d1 | 4(4:0)
|
||||
*-------------------------------------------------------*
|
||||
move.l d4,a2
|
||||
move.l d3,a3
|
||||
move.l d2,a4
|
||||
move.l d1,a5
|
||||
*-------------------------------------------------------*
|
||||
move.w _screenh,d6
|
||||
subq.w #1,d6
|
||||
*-------------------------------------------------------*
|
||||
rplanes_ylp: move.w line_long_width,d5
|
||||
move.w dst_line_offset,d0
|
||||
lea (a1,d0.w),a1
|
||||
*-------------------------------------------------------*
|
||||
rplanes_xlp: tst.w d5
|
||||
bne.s rplanes_nono
|
||||
move.w src_line_offset,d0
|
||||
lea (a0,d0.w),a0 | offset D0 pixels to beginning of next line
|
||||
rplanes_nono: movem.l (a0)+,d1-d4
|
||||
*-------------------------------------------------------*
|
||||
move.l #0x00FF00FF,d0 | 4
|
||||
splice 8 d1 d3 d0 d7 | 18
|
||||
splice 8 d2 d4 d0 d7 | 18
|
||||
*-------------------------------------------------------*
|
||||
move.l a2,(a1)+
|
||||
*-------------------------------------------------------*
|
||||
move.l #0x0F0F0F0F,d0 | 4
|
||||
splice 4 d1 d2 d0 d7 | 18
|
||||
splice 4 d3 d4 d0 d7 | 18
|
||||
*-------------------------------------------------------*
|
||||
move.l a3,(a1)+
|
||||
*-------------------------------------------------------*
|
||||
swap d2 | 4(4:0)
|
||||
swap d4 | 4(4:0)
|
||||
eor.w d1,d2 | 2(2:0)
|
||||
eor.w d3,d4 | 2(2:0)
|
||||
eor.w d2,d1 | 2(2:0)
|
||||
eor.w d4,d3 | 2(2:0)
|
||||
eor.w d1,d2 | 2(2:0)
|
||||
eor.w d3,d4 | 2(2:0)
|
||||
swap d2 | 4(4:0)
|
||||
swap d4 | 4(4:0)
|
||||
*-------------------------------------------------------*
|
||||
move.l #0x33333333,d0 | 4
|
||||
splice 2 d1 d2 d0 d7 | 18
|
||||
splice 2 d3 d4 d0 d7 | 18
|
||||
*-------------------------------------------------------*
|
||||
move.l a4,(a1)+
|
||||
*-------------------------------------------------------*
|
||||
move.l #0x55555555,d0 | 4
|
||||
splice 1 d1 d3 d0 d7 | 18
|
||||
splice 1 d2 d4 d0 d7 | 18
|
||||
*-------------------------------------------------------*
|
||||
move.l a5,(a1)+
|
||||
*-------------------------------------------------------*
|
||||
* 32-bit destination *
|
||||
*-------------------------------------------------------*
|
||||
swap d4 | 4(4:0)
|
||||
eor.w d2,d4 | 2(2:0)
|
||||
eor.w d4,d2 | 2(2:0)
|
||||
eor.w d2,d4 | 2(2:0)
|
||||
swap d2 | 4(4:0)
|
||||
swap d3 | 4(4:0)
|
||||
eor.w d1,d3 | 2(2:0)
|
||||
eor.w d3,d1 | 2(2:0)
|
||||
eor.w d1,d3 | 2(2:0)
|
||||
swap d1 | 4(4:0)
|
||||
*-------------------------------------------------------*
|
||||
move.l d4,a2
|
||||
move.l d3,a3
|
||||
move.l d2,a4
|
||||
move.l d1,a5
|
||||
*-------------------------------------------------------*
|
||||
dbra d5,rplanes_xlp
|
||||
| tst.w d6
|
||||
| beq.s rplanes_none
|
||||
dbra d6,rplanes_ylp
|
||||
*-------------------------------------------------------*
|
||||
|rplanes_none: move.l a2,(a1)+
|
||||
| move.l a3,(a1)+
|
||||
| move.l a4,(a1)+
|
||||
| move.l a5,(a1)+
|
||||
*-------------------------------------------------------*
|
||||
movem.l (sp)+,d0-a6
|
||||
*-------------------------------------------------------*
|
||||
rts
|
||||
|
||||
*-------------------------------------------------------*
|
||||
.bss
|
||||
*-------------------------------------------------------*
|
||||
src_line_offset: ds.w 1
|
||||
dst_line_offset: ds.w 1
|
||||
line_long_width: ds.w 1
|
||||
*-------------------------------------------------------*
|
||||
@@ -0,0 +1,187 @@
|
||||
| c2p_unid.S - Atari Falcon chunky to planar DELTA conversion
|
||||
|
|
||||
| Copyright (c) 1996 Douglas Little
|
||||
| Copyright (c) 1997-1998 Petr Stehlik and Karel Rous
|
||||
| Copyright (c) 1998-2008 Atari800 development team (see DOC/CREDITS)
|
||||
|
|
||||
| This file is part of the Atari800 emulator project which emulates
|
||||
| the Atari 400, 800, 800XL, 130XE, and 5200 8-bit computers.
|
||||
|
|
||||
| Atari800 is free software; you can redistribute it and/or modify
|
||||
| it under the terms of the GNU General Public License as published by
|
||||
| the Free Software Foundation; either version 2 of the License, or
|
||||
| (at your option) any later version.
|
||||
|
|
||||
| Atari800 is distributed in the hope that it will be useful,
|
||||
| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
| GNU General Public License for more details.
|
||||
|
|
||||
| You should have received a copy of the GNU General Public License
|
||||
| along with Atari800; if not, write to the Free Software
|
||||
| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
*-------------------------------------------------------*
|
||||
|
||||
*-------------------------------------------------------*
|
||||
* external variables *
|
||||
*-------------------------------------------------------*
|
||||
|
||||
.globl _screenw,_screenh
|
||||
.globl _vramw,_vramh
|
||||
.globl _odkud,_kam
|
||||
.globl _oldscreen
|
||||
|
||||
*-------------------------------------------------------*
|
||||
* General functions *
|
||||
*-------------------------------------------------------*
|
||||
|
||||
.globl _rplanes_delta_init
|
||||
.globl _rplanes_delta
|
||||
|
||||
*-------------------------------------------------------*
|
||||
.include "falcon/c2pmac.S"
|
||||
*-------------------------------------------------------*
|
||||
|
||||
*-------------------------------------------------------*
|
||||
* Initialise rendering display *
|
||||
*-------------------------------------------------------*
|
||||
_rplanes_delta_init:
|
||||
*-------------------------------------------------------*
|
||||
rts
|
||||
*-------------------------------------------------------*
|
||||
*-------------------------------------------------------*
|
||||
* display conversion *
|
||||
*-------------------------------------------------------*
|
||||
_rplanes_delta:
|
||||
*-------------------------------------------------------*
|
||||
movem.l d2-d7/a2-a5,-(sp)
|
||||
*-------------------------------------------------------*
|
||||
|
||||
move.l _odkud,a0
|
||||
move.l _kam,a1
|
||||
move.l _oldscreen,a2
|
||||
|
||||
| centering of view at screen
|
||||
move.w #384,d0 | width of Atari800 emulated screen
|
||||
sub.w _screenw,d0 | width of displayed screen
|
||||
movea.w d0,a3
|
||||
lsr.w #1,d0 | centering
|
||||
lea (a0,d0.w),a0 | offset 24 or 32 pixels
|
||||
lea (a2,d0.w),a2 | offset 24 or 32 pixels
|
||||
|
||||
| centering of screen in videoram in horizontal axis
|
||||
move.w _vramw,d0
|
||||
sub.w _screenw,d0
|
||||
movea.w d0,a4
|
||||
lsr.w #1,d0
|
||||
neg.w d0
|
||||
lea (a1,d0.w),a1 | negative pre-offset (will be OK at rplanes_delta_ylp)
|
||||
|
||||
| centering of screen in videoram in vertical axis
|
||||
move.w _vramh,d0
|
||||
sub.w _screenh,d0
|
||||
lsr.w #1,d0
|
||||
move.w _vramw,d1
|
||||
mulu d1,d0
|
||||
lea (a1,d0.l),a1
|
||||
|
||||
| precompute line width in long words
|
||||
move.w _screenw,d0
|
||||
lsr.w #4,d0
|
||||
subq.w #1,d0
|
||||
movea.w d0,a5
|
||||
|
||||
*-------------------------------------------------------*
|
||||
move.w _screenh,d6
|
||||
subq.w #1,d6
|
||||
move.w a5,d5
|
||||
nop | for cache alignment
|
||||
*-------------------------------------------------------*
|
||||
rplanes_delta_xlp:
|
||||
move.l (a0)+,d4
|
||||
move.l (a0)+,d3
|
||||
move.l (a0)+,d2
|
||||
move.l (a0)+,d1
|
||||
*-------------------------------------------------------*
|
||||
moveq #12,d0
|
||||
cmp.l (a2)+,d4
|
||||
bne.s rplanes_delta_doit
|
||||
moveq #8,d0
|
||||
cmp.l (a2)+,d3
|
||||
bne.s rplanes_delta_doit
|
||||
moveq #4,d0
|
||||
cmp.l (a2)+,d2
|
||||
bne.s rplanes_delta_doit
|
||||
cmp.l (a2)+,d1
|
||||
bne.s rplanes_delta_doit2
|
||||
lea 16(a1),a1
|
||||
dbra d5,rplanes_delta_xlp
|
||||
adda.l a3,a0
|
||||
adda.l a3,a2
|
||||
adda.l a4,a1
|
||||
move.w a5,d5
|
||||
dbra d6,rplanes_delta_xlp
|
||||
bra rplanes_delta_none
|
||||
rplanes_delta_doit:
|
||||
adda.l d0,a2
|
||||
rplanes_delta_doit2:
|
||||
*-------------------------------------------------------*
|
||||
move.l #0x00FF00FF,d0 | 4
|
||||
splice 8 d4 d2 d0 d7 | 18
|
||||
splice 8 d3 d1 d0 d7 | 18
|
||||
*-------------------------------------------------------*
|
||||
move.l #0x0F0F0F0F,d0 | 4
|
||||
splice 4 d4 d3 d0 d7 | 18
|
||||
splice 4 d2 d1 d0 d7 | 18
|
||||
*-------------------------------------------------------*
|
||||
swap d3 | 4(4:0)
|
||||
swap d1 | 4(4:0)
|
||||
eor.w d4,d3 | 2(2:0)
|
||||
eor.w d2,d1 | 2(2:0)
|
||||
eor.w d3,d4 | 2(2:0)
|
||||
eor.w d1,d2 | 2(2:0)
|
||||
eor.w d4,d3 | 2(2:0)
|
||||
eor.w d2,d1 | 2(2:0)
|
||||
swap d3 | 4(4:0)
|
||||
swap d1 | 4(4:0)
|
||||
*-------------------------------------------------------*
|
||||
move.l #0x33333333,d0 | 4
|
||||
splice 2 d4 d3 d0 d7 | 18
|
||||
splice 2 d2 d1 d0 d7 | 18
|
||||
*-------------------------------------------------------*
|
||||
move.l #0x55555555,d0 | 4
|
||||
splice 1 d4 d2 d0 d7 | 18
|
||||
splice 1 d3 d1 d0 d7 | 18
|
||||
*-------------------------------------------------------*
|
||||
* 32-bit destination *
|
||||
*-------------------------------------------------------*
|
||||
swap d1 | 4(4:0)
|
||||
eor.w d3,d1 | 2(2:0)
|
||||
eor.w d1,d3 | 2(2:0)
|
||||
eor.w d3,d1 | 2(2:0)
|
||||
swap d3 | 4(4:0)
|
||||
swap d2 | 4(4:0)
|
||||
eor.w d4,d2 | 2(2:0)
|
||||
eor.w d2,d4 | 2(2:0)
|
||||
eor.w d4,d2 | 2(2:0)
|
||||
swap d4 | 4(4:0)
|
||||
*-------------------------------------------------------*
|
||||
move.l d1,(a1)+
|
||||
move.l d2,(a1)+
|
||||
move.l d3,(a1)+
|
||||
move.l d4,(a1)+
|
||||
*-------------------------------------------------------*
|
||||
dbra d5,rplanes_delta_xlp
|
||||
adda.l a3,a0
|
||||
adda.l a3,a2
|
||||
adda.l a4,a1
|
||||
move.w a5,d5
|
||||
dbra d6,rplanes_delta_xlp
|
||||
*-------------------------------------------------------*
|
||||
rplanes_delta_none:
|
||||
*-------------------------------------------------------*
|
||||
movem.l (sp)+,d2-d7/a2-a5
|
||||
*-------------------------------------------------------*
|
||||
rts
|
||||
*-------------------------------------------------------*
|
||||
@@ -0,0 +1,32 @@
|
||||
| c2pmac.S - Atari Falcon chunky to planar conversion helper macro
|
||||
|
|
||||
| Copyright (c) 1996 Douglas Little
|
||||
| Copyright (c) 1997-1998 Petr Stehlik and Karel Rous
|
||||
| Copyright (c) 1998-2008 Atari800 development team (see DOC/CREDITS)
|
||||
|
|
||||
| This file is part of the Atari800 emulator project which emulates
|
||||
| the Atari 400, 800, 800XL, 130XE, and 5200 8-bit computers.
|
||||
|
|
||||
| Atari800 is free software; you can redistribute it and/or modify
|
||||
| it under the terms of the GNU General Public License as published by
|
||||
| the Free Software Foundation; either version 2 of the License, or
|
||||
| (at your option) any later version.
|
||||
|
|
||||
| Atari800 is distributed in the hope that it will be useful,
|
||||
| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
| GNU General Public License for more details.
|
||||
|
|
||||
| You should have received a copy of the GNU General Public License
|
||||
| along with Atari800; if not, write to the Free Software
|
||||
| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
.macro splice p0 p1 p2 p3 p4 | data1,data2,mask,temp
|
||||
move.l \p2,\p4 | 2(2:0) (1:1) EEFFGGHH
|
||||
lsr.l #\p0,\p4 | 4(4:0) (1:2) plice3_.EEFFGG
|
||||
eor.l \p1,\p4 | 2(2:0) (1:1) plice3_.EEFFGG^AABBCCDD
|
||||
and.l \p3,\p4 | 2(2:0) (1:1) plice3_.EE..GG^plice3_.BB..DD
|
||||
eor.l \p4,\p1 | 2(2:0) (1:1) AAEECCGG (AABBCCDD^plice3_.EE..GG^plice3_.BB..DD)
|
||||
lsl.l #\p0,\p4 | 4(4:0) (1:2) EE..GG..^BB..DD..
|
||||
eor.l \p4,\p2 | 2(2:0) (1:1) BBFFDDHH (EEFFGGHH^EE..GG..^BB..DD..)
|
||||
.endm | 7 ops / 14 bytes / 68030=18(18:0) / 68040=(7:9)
|
||||
@@ -0,0 +1,252 @@
|
||||
| ikbd.asm - Atari Falcon specific port code
|
||||
|
|
||||
| Copyright (c) 1997-1998 Petr Stehlik and Karel Rous
|
||||
| Copyright (c) 1998-2003 Atari800 development team (see DOC/CREDITS)
|
||||
|
|
||||
| This file is part of the Atari800 emulator project which emulates
|
||||
| the Atari 400, 800, 800XL, 130XE, and 5200 8-bit computers.
|
||||
|
|
||||
| Atari800 is free software; you can redistribute it and/or modify
|
||||
| it under the terms of the GNU General Public License as published by
|
||||
| the Free Software Foundation; either version 2 of the License, or
|
||||
| (at your option) any later version.
|
||||
|
|
||||
| Atari800 is distributed in the hope that it will be useful,
|
||||
| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
| GNU General Public License for more details.
|
||||
|
|
||||
| You should have received a copy of the GNU General Public License
|
||||
| along with Atari800; if not, write to the Free Software
|
||||
| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
.globl _init_kb
|
||||
.globl _rem_kb
|
||||
.globl _key_buf
|
||||
.globl _joy0
|
||||
.globl _joy1
|
||||
.globl _buttons
|
||||
.globl _kbhead
|
||||
.globl _keybuf
|
||||
*=======================================================*
|
||||
* IKBD routines: latest update 25/03/96 *
|
||||
*=======================================================*
|
||||
* Handle keyboard & mouse *
|
||||
*=======================================================*
|
||||
|
||||
.set ikbd,0x118 | keyboard vector
|
||||
.set key_ctl,0xfffffc00 | keyboard control register
|
||||
.set key_dat,0xfffffc02 | keyboard data register
|
||||
|
||||
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*
|
||||
* Initialise custom keyboard packet handler *
|
||||
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*
|
||||
_init_kb:
|
||||
initialise_ikbd:
|
||||
*-------------------------------------------------------*
|
||||
bsr empty_buffer
|
||||
lea key_buffer,a0
|
||||
moveq #(128/4)-1,d7
|
||||
nitialise_ikbd_clear_keybd:
|
||||
clr.l (a0)+
|
||||
dbf d7,nitialise_ikbd_clear_keybd
|
||||
move.l ikbd.w,old_ikbd
|
||||
move.l #ikbd_handler,ikbd.w
|
||||
bsr flush_ikbd
|
||||
rts
|
||||
|
||||
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*
|
||||
* Remove custom keyboard packet handler *
|
||||
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*
|
||||
_rem_kb:
|
||||
remove_ikbd:
|
||||
*-------------------------------------------------------*
|
||||
move.l old_ikbd,ikbd.w
|
||||
bsr flush_ikbd
|
||||
bsr empty_buffer
|
||||
rts
|
||||
|
||||
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*
|
||||
* Remove unread data from ikbd chip *
|
||||
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*
|
||||
flush_ikbd:
|
||||
*-------------------------------------------------------*
|
||||
lush_ikbd_wl: tst.b key_dat.w
|
||||
bpl.s lush_ikbd_wl
|
||||
move.b key_ctl.w,d0
|
||||
btst #0,d0
|
||||
bne.s lush_ikbd_read
|
||||
rts
|
||||
lush_ikbd_read: move.b key_dat.w,d0
|
||||
bra.s flush_ikbd
|
||||
|
||||
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*
|
||||
* Keyboard Packet handler *
|
||||
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*
|
||||
ikbd_handler:
|
||||
*-------------------------------------------------------*
|
||||
movem.l a0/d0-d1,-(sp)
|
||||
|
||||
ikbd_loop:
|
||||
move.b key_ctl.w,d0
|
||||
|
||||
btst #7,d0
|
||||
beq ikbd_aq2
|
||||
|
||||
btst #4,d0
|
||||
bne ik_err
|
||||
btst #5,d0
|
||||
bne ik_err
|
||||
btst #6,d0
|
||||
bne ik_err
|
||||
btst #0,d0
|
||||
beq ik_err
|
||||
|
||||
move.b key_dat.w,d0
|
||||
|
||||
cmp.b #0xff,d0 | joystick 1 packet
|
||||
beq.s do_joy1
|
||||
cmp.b #0xfe,d0 | joystick 0 packet
|
||||
beq.s do_joy0
|
||||
|
||||
mouse_event:
|
||||
move.b d0,d1
|
||||
and.b #0xfc,d1 | 0b111110xx = mouse packet
|
||||
cmp.b #0xf8,d1
|
||||
bne.s key_press
|
||||
and.b #3,d0
|
||||
move.b d0,buttons
|
||||
move.l #get_dx,ikbd.w
|
||||
bra.s ikbd_aq
|
||||
|
||||
do_joy0:
|
||||
move.l #get_joy0,ikbd.w
|
||||
bra.s ikbd_aq
|
||||
|
||||
do_joy1:
|
||||
move.l #get_joy1,ikbd.w
|
||||
bra.s ikbd_aq
|
||||
|
||||
|
||||
key_press:
|
||||
move.l _kbhead,d1
|
||||
lea _keybuf,a0
|
||||
move.b d0,(a0,d1.l)
|
||||
addq.l #1,d1
|
||||
and.w #256-1,d1
|
||||
move.l d1,_kbhead
|
||||
|
||||
btst #7,d0 | test release bit
|
||||
seq d1 | d1.b cleared if release bit set
|
||||
and.w #0x7f,d0 | mask off release bit
|
||||
lea key_buffer,a0
|
||||
move.b d1,(a0,d0.w)
|
||||
|
||||
ikbd_aq:
|
||||
|
||||
btst #0,key_ctl.w
|
||||
bne ikbd_loop
|
||||
|
||||
ikbd_aq2:
|
||||
|
||||
bclr #6,0xfffffa11.w
|
||||
movem.l (sp)+,a0/d0-d1
|
||||
rte
|
||||
|
||||
|
||||
ik_err: move.l #ikbd_handler,ikbd.w
|
||||
k_err_ikl: btst #0,key_ctl.w
|
||||
beq.s k_err_clr
|
||||
move.b key_dat.w,d0
|
||||
bra.s k_err_ikl
|
||||
k_err_clr: bra.s ikbd_aq
|
||||
|
||||
get_dx:
|
||||
movem.l a0/d0-d1,-(sp)
|
||||
|
||||
move.b key_ctl.w,d0
|
||||
btst #4,d0
|
||||
bne.s ik_err
|
||||
btst #5,d0
|
||||
bne.s ik_err
|
||||
btst #6,d0
|
||||
bne.s ik_err
|
||||
btst #0,d0
|
||||
beq.s ik_err
|
||||
|
||||
move.b key_dat.w,d0
|
||||
ext.w d0
|
||||
add d0,mouse_dx
|
||||
move.l #get_dy,ikbd.w
|
||||
|
||||
bra.s ikbd_aq
|
||||
|
||||
get_dy:
|
||||
movem.l a0/d0-d1,-(sp)
|
||||
|
||||
move.b key_ctl.w,d0
|
||||
btst #4,d0
|
||||
bne.s ik_err
|
||||
btst #5,d0
|
||||
bne.s ik_err
|
||||
btst #6,d0
|
||||
bne.s ik_err
|
||||
btst #0,d0
|
||||
beq.s ik_err
|
||||
|
||||
move.b key_dat.w,d0
|
||||
ext.w d0
|
||||
add d0,mouse_dy
|
||||
move.l #ikbd_handler,ikbd.w
|
||||
|
||||
bra ikbd_aq
|
||||
|
||||
get_joy1:
|
||||
move.b key_dat.w,joy0
|
||||
move.l #ikbd_handler,ikbd.w
|
||||
bclr #6,0xfffffa11.w
|
||||
rte
|
||||
|
||||
get_joy0:
|
||||
move.b key_dat.w,joy1
|
||||
move.l #ikbd_handler,ikbd.w
|
||||
bclr #6,0xfffffa11.w
|
||||
rte
|
||||
|
||||
*-------------------------------------------------------*
|
||||
* Flush keyboard buffer *
|
||||
*-------------------------------------------------------*
|
||||
empty_buffer:
|
||||
*-------------------------------------------------------*
|
||||
mpty_buffer_bk: move.w #11,-(sp)
|
||||
trap #1
|
||||
addq #2,sp
|
||||
tst.w d0
|
||||
beq.s mpty_buffer_ot
|
||||
move.w #7,-(sp)
|
||||
trap #1
|
||||
addq #2,sp
|
||||
bra.s mpty_buffer_bk
|
||||
mpty_buffer_ot: rts
|
||||
|
||||
*-------------------------------------------------------*
|
||||
.bss
|
||||
*-------------------------------------------------------*
|
||||
|
||||
old_ikbd: ds.l 1
|
||||
old_mousevec: ds.l 1
|
||||
key_recptr: ds.l 1
|
||||
|
||||
last_key: ds.w 1
|
||||
mouse_dx: ds.w 1
|
||||
mouse_dy: ds.w 1
|
||||
|
||||
_joy0:
|
||||
joy0: ds.b 1
|
||||
_joy1:
|
||||
joy1: ds.b 1
|
||||
_buttons:
|
||||
buttons: ds.b 1
|
||||
|
||||
_key_buf:
|
||||
key_buffer: ds.w 64
|
||||
@@ -0,0 +1,121 @@
|
||||
#ifndef _JCLKCOOK_H_
|
||||
#define _JCLKCOOK_H_
|
||||
|
||||
/* Joy Clocky CookieJar public interface header file */
|
||||
|
||||
#define CLOCKY_IDENT 'JCLK'
|
||||
#define CLOCKY_IDENT_STR "JCLK"
|
||||
#define CLOCKY_IDENT_NUM 0x4A434C4BUL
|
||||
#define CLOCKY_VERSION 0x300
|
||||
|
||||
struct _switches {
|
||||
unsigned ShowTime:1; /* 31 - General Display switch (bits 30-24 depend on this bit being set) */
|
||||
unsigned ShowIDT:1; /* 30 - Follow the International settings (date&time format) */
|
||||
unsigned ShowDate:1; /* 29 - Display also the date line */
|
||||
unsigned ShowDay:1; /* 28 - Display Day of Week and special symbols */
|
||||
unsigned ShowYear:1; /* 27 - Display Year (two digits) and seconds */
|
||||
unsigned ShowDigi:1; /* 26 - Use digital numbers for displaying */
|
||||
unsigned ShowBig:1; /* 25 - Use big font for displaying */
|
||||
unsigned ShowTrn:1; /* 24 - Transparent displaying */
|
||||
|
||||
unsigned KbdAltK:1; /* 23 - Handle Alt-key and Alt-Shift-key combos */
|
||||
unsigned KbdEHC:1; /* 22 - External HotKeys active */
|
||||
unsigned KbdDead:1; /* 21 - Dead Key active */
|
||||
unsigned KbdAltChar:1; /* 20 - Alt+number for entering unusual characters */
|
||||
unsigned KbdClick:1; /* 19 - turn OFF clicking sound of typing */
|
||||
unsigned KbdBell:1; /* 18 - turn OFF the warning bell sound */
|
||||
unsigned KbdLayout:2; /* 16-17 - define keyboard layout: 0 = no change, 1 = TOS original, 2 = normal, 3 = coding */
|
||||
|
||||
unsigned MiscMS4x:1; /* 15 - accelerate mouse 4x (depends on MiscMouse being set) */
|
||||
unsigned MiscMouse:1; /* 14 - mouse accelerator 2x active */
|
||||
unsigned MiscPrnt:1; /* 13 - on-line conversion of printed data active */
|
||||
unsigned MiscTurbo:1; /* 12 - MegaSTE's 16 MHz + data cache active */
|
||||
unsigned MiscBeep:1; /* 11 - "time sign" - a beep every hour */
|
||||
unsigned unused1:1;
|
||||
unsigned unused2:1;
|
||||
unsigned unused3:1;
|
||||
|
||||
unsigned SaverOn:1; /* 7 - General Screen Saver switch (affects savecount, 6-2 depends on this bit being set) */
|
||||
unsigned SaveMod1:1; /* 6 - Modem1 CD check */
|
||||
unsigned SaveMod2:1; /* 5 - Modem2 CD check */
|
||||
unsigned SaveSer2:1; /* 4 - Serial2 CD check */
|
||||
unsigned SaveVESA:1; /* 3 - use VESA Powersaving features of modern VGA monitors */
|
||||
unsigned SaveSTacy:1; /* 2 - save STacy LED */
|
||||
unsigned Unused:2; /* 0-1 */
|
||||
};
|
||||
|
||||
struct _bootsetup {
|
||||
unsigned HookXBIOS:1;
|
||||
unsigned HookVBL:1;
|
||||
unsigned HookKbd:1;
|
||||
unsigned HookMouse:1;
|
||||
unsigned HookPrint:1;
|
||||
unsigned unused2:3;
|
||||
/* */
|
||||
unsigned unused1:4;
|
||||
unsigned FixY2K:1; /* enables a workaround in XBIOS Gettime() that fixes an Y2K bug in older TOS */
|
||||
unsigned Settime:1; /* follow XBIOS Settime() for detecting date/time changes if DTCOOKIE is not found */
|
||||
unsigned EngSys:1; /* simulate English TOS */
|
||||
unsigned InvVideo:1; /* invert colors on boot (white on black) */
|
||||
};
|
||||
|
||||
typedef struct _bootsetup BOOTSETUP;
|
||||
|
||||
#define SCAN_CODES 128
|
||||
#define ALT_LEN 32
|
||||
#define KBDLEN (3*SCAN_CODES + 3*ALT_LEN)
|
||||
#define PRNTBLLEN 128
|
||||
#define DEADTBLLEN 40
|
||||
#define HOTKEYS 16
|
||||
|
||||
struct _jclkstruct {
|
||||
long name; /* compare with CLOCKY_IDENT, must be equal */
|
||||
short version; /* compare with CLOCKY_VERSION, see below */
|
||||
union {
|
||||
struct _switches par;
|
||||
long lparam;
|
||||
} switches;
|
||||
short SaverLen; /* time of inactivity in seconds after which the screen saver is activated */
|
||||
short SaverCount; /* counts the time of inactivity - when Savercount >= SaverLen the saver is activated */
|
||||
char hotshift; /* bits 0..3, 0 = no hotkeys */
|
||||
char hottime; /* bits 0..3, 0 = no hottime */
|
||||
char reserved1; /* currently unused */
|
||||
char actual_key; /* currently pressed Alt-Ctrl hot key - scancode in range <1,127> */
|
||||
char *ehc_table; /* ptr to char ehc_table[128] */
|
||||
short ShowPos; /* position of clock on screen in columns from right border; if negative then it is the -(position from the left border+1) */
|
||||
unsigned char ShowColorB; /* background color in the range <0,15> */
|
||||
unsigned char ShowColorF; /* foreground color in the range <0,15> */
|
||||
BOOTSETUP boot;
|
||||
short refresh;
|
||||
char normal_kbd[KBDLEN];
|
||||
char ceska_kbd[KBDLEN];
|
||||
char prntable[PRNTBLLEN];
|
||||
char deadkey;
|
||||
char deadkeys_defined;
|
||||
char deadtable1[DEADTBLLEN];
|
||||
char deadtable2[DEADTBLLEN];
|
||||
char deadtable3[DEADTBLLEN];
|
||||
char hotkeys[HOTKEYS];
|
||||
char weekdays[7][2];
|
||||
};
|
||||
|
||||
typedef struct _jclkstruct JCLKSTRUCT;
|
||||
|
||||
#include <assert.h>
|
||||
#define CHECK_CLOCKY_STRUCT assert( sizeof(JCLKSTRUCT) == 30 );
|
||||
|
||||
/* how to check for the right Clocky struct version */
|
||||
/*
|
||||
|
||||
if ((version >= CLOCKY_VERSION) && ((version / 0x100) == (CLOCKY_VERSION / 0x100)))
|
||||
{
|
||||
version is OK
|
||||
}
|
||||
else
|
||||
{
|
||||
get newer version
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
#endif /* _JCLKCOOK_H_ */
|
||||
@@ -0,0 +1,30 @@
|
||||
#ifndef _RES_H_
|
||||
#define _RES_H_
|
||||
|
||||
/* Aufl”sungsstruktur */
|
||||
/* L„nge der Struktur: 86 Bytes */
|
||||
typedef struct
|
||||
{
|
||||
char name[33]; /* Name der Aufl”sung */
|
||||
/* F�r Nicht-C-Programmierer: */
|
||||
/* der Offset der n„chsten Variablen */
|
||||
/* zum Strukturstart betr„gt 34 Bytes */
|
||||
short mode; /* Aufl”sungsart (siehe ICB.H) */
|
||||
short bypl; /* Bytes pro Zeile */
|
||||
short planes; /* Anzahl Planes */
|
||||
unsigned short colors; /* Anzahl Farben */
|
||||
short hc_mode; /* Hardcopy-Modus */
|
||||
short max_x, max_y; /* maximale x- und y-Koordinate */
|
||||
short real_x, real_y; /* reale max. x- und y-Koordinate */
|
||||
/* folgende Variablen sollten nicht */
|
||||
/* beachtet werden */
|
||||
short freq; /* Frequenz in MHz */
|
||||
char freq2; /* 2. Frequenz (SIGMA Legend II) */
|
||||
char low_res; /* halbe Pixelrate */
|
||||
/* Bit 2: Erweiterungsbit f�r h_total */
|
||||
unsigned char r_3c2; /* Register 3c2 */
|
||||
unsigned char r_3d4[25]; /* Register 3d4, Index 0 bis $18 */
|
||||
unsigned char extended[3]; /* Register 3d4, Index $33 bis $35 */
|
||||
} RESOLUTION;
|
||||
|
||||
#endif /* _RES_H_ */
|
||||
@@ -0,0 +1,44 @@
|
||||
| sound_dma.asm - Atari Falcon specific port code
|
||||
|
|
||||
| Copyright (c) 1997-1998 Petr Stehlik and Karel Rous
|
||||
| Copyright (c) 1998-2003 Atari800 development team (see DOC/CREDITS)
|
||||
|
|
||||
| This file is part of the Atari800 emulator project which emulates
|
||||
| the Atari 400, 800, 800XL, 130XE, and 5200 8-bit computers.
|
||||
|
|
||||
| Atari800 is free software; you can redistribute it and/or modify
|
||||
| it under the terms of the GNU General Public License as published by
|
||||
| the Free Software Foundation; either version 2 of the License, or
|
||||
| (at your option) any later version.
|
||||
|
|
||||
| Atari800 is distributed in the hope that it will be useful,
|
||||
| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
| GNU General Public License for more details.
|
||||
|
|
||||
| You should have received a copy of the GNU General Public License
|
||||
| along with Atari800; if not, write to the Free Software
|
||||
| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
.globl _timer_A
|
||||
.globl _timer_A_v_C
|
||||
|
||||
_timer_A:
|
||||
tst.b semafor
|
||||
bne.s konec
|
||||
st semafor
|
||||
|
||||
movem.l d0-d7/a0-a6,zaloha_registru
|
||||
jsr _timer_A_v_C
|
||||
movem.l zaloha_registru,d0-d7/a0-a6
|
||||
|
||||
sf semafor
|
||||
konec: rte
|
||||
|
||||
.bss
|
||||
zaloha_registru:
|
||||
ds.l 15
|
||||
zaloha_SR:
|
||||
ds.w 1
|
||||
semafor:
|
||||
ds.b 1
|
||||
@@ -0,0 +1,318 @@
|
||||
| videl.asm - Atari Falcon specific port code
|
||||
|
|
||||
| Copyright (c) 1997-1998 Petr Stehlik and Karel Rous
|
||||
| Copyright (c) 1998-2003 Atari800 development team (see DOC/CREDITS)
|
||||
|
|
||||
| This file is part of the Atari800 emulator project which emulates
|
||||
| the Atari 400, 800, 800XL, 130XE, and 5200 8-bit computers.
|
||||
|
|
||||
| Atari800 is free software; you can redistribute it and/or modify
|
||||
| it under the terms of the GNU General Public License as published by
|
||||
| the Free Software Foundation; either version 2 of the License, or
|
||||
| (at your option) any later version.
|
||||
|
|
||||
| Atari800 is distributed in the hope that it will be useful,
|
||||
| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
| GNU General Public License for more details.
|
||||
|
|
||||
| You should have received a copy of the GNU General Public License
|
||||
| along with Atari800; if not, write to the Free Software
|
||||
| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
.globl _load_r,_save_r,_p_str_p
|
||||
*-------------------------------------------------------*
|
||||
.text
|
||||
*-------------------------------------------------------*
|
||||
.set none,-1
|
||||
|
||||
*-------------------------------------------------------*
|
||||
|
||||
*-------------------------------------------------------*
|
||||
.set plane_bits,0+0 | 0
|
||||
.set true_bit,0+2 | 2
|
||||
.set hires_bit,0+3 | 3
|
||||
.set vga_bit,0+4 | 4
|
||||
.set pal_bit,0+5 | 5
|
||||
.set os_bit,0+6 | 6
|
||||
.set compat_bit,0+7 | 7
|
||||
.set lace_bit,0+8 | 8
|
||||
|
||||
*-------------------------------------------------------*
|
||||
|
||||
*-------------------------------------------------------*
|
||||
.set bpl1,0+0
|
||||
.set bpl2,0+1
|
||||
.set bpl4,0+2
|
||||
.set bpl8,0+3
|
||||
|
||||
*-------------------------------------------------------*
|
||||
|
||||
.set true,1<<true_bit
|
||||
.set hires,1<<hires_bit
|
||||
.set vga,1<<vga_bit
|
||||
.set pal,1<<pal_bit
|
||||
.set os,1<<os_bit
|
||||
.set compat,1<<compat_bit
|
||||
.set lace,1<<lace_bit
|
||||
|
||||
*-------------------------------------------------------*
|
||||
* Videl registers *
|
||||
*-------------------------------------------------------*
|
||||
|
||||
.set RShift,0xFFFF8260
|
||||
.set RSpShift,0xFFFF8266
|
||||
.set RWrap,0xFFFF8210
|
||||
.set RSync,0xFFFF820A
|
||||
.set RCO,0xFFFF82C0
|
||||
.set RMode,0xFFFF82C2
|
||||
.set RHHT,0xFFFF8282
|
||||
.set RHBB,0xFFFF8284
|
||||
.set RHBE,0xFFFF8286
|
||||
.set RHDB,0xFFFF8288
|
||||
.set RHDE,0xFFFF828A
|
||||
.set RHSS,0xFFFF828C
|
||||
.set RHFS,0xFFFF828E
|
||||
.set RHEE,0xFFFF8290
|
||||
.set RVFT,0xFFFF82A2
|
||||
.set RVBB,0xFFFF82A4
|
||||
.set RVBE,0xFFFF82A6
|
||||
.set RVDB,0xFFFF82A8
|
||||
.set RVDE,0xFFFF82AA
|
||||
.set RVSS,0xFFFF82AC
|
||||
|
||||
*-------------------------------------------------------*
|
||||
* Videl register file *
|
||||
*-------------------------------------------------------*
|
||||
|
||||
*-------------------------------------------------------*
|
||||
.set patch_code,0+0 | fake modecode (describes register file)
|
||||
*-------------------------------------------------------*
|
||||
.set patch_size,0+2 | total display memory
|
||||
.set patch_width,0+6 | horizontal res
|
||||
.set patch_height,0+8 | vertical res
|
||||
.set patch_depth,0+10 | colour depth (bits per pixel)
|
||||
*-------------------------------------------------------*
|
||||
.set patch_RShift,0+12 | register file
|
||||
.set patch_RSync,0+13
|
||||
.set patch_RSpShift,0+14
|
||||
.set patch_RWrap,0+16
|
||||
.set patch_RCO,0+18
|
||||
.set patch_RMode,0+20
|
||||
.set patch_RHHT,0+22
|
||||
.set patch_RHBB,0+24
|
||||
.set patch_RHBE,0+26
|
||||
.set patch_RHDB,0+28
|
||||
.set patch_RHDE,0+30
|
||||
.set patch_RHSS,0+32
|
||||
.set patch_RHFS,0+34
|
||||
.set patch_RHEE,0+36
|
||||
.set patch_RVFT,0+38
|
||||
.set patch_RVBB,0+40
|
||||
.set patch_RVBE,0+42
|
||||
.set patch_RVDB,0+44
|
||||
.set patch_RVDE,0+46
|
||||
.set patch_RVSS,0+48
|
||||
*-------------------------------------------------------*
|
||||
.set patch_slen,0+50
|
||||
*-------------------------------------------------------*
|
||||
|
||||
.set hz200,0x4ba
|
||||
.set vbcount,0x462
|
||||
|
||||
*-------------------------------------------------------*
|
||||
* Load Videl registers *
|
||||
*-------------------------------------------------------*
|
||||
_load_r:
|
||||
*-------------------------------------------------------*
|
||||
* Register file pointer *
|
||||
*-------------------------------------------------------*
|
||||
move.l _p_str_p,a0
|
||||
*-------------------------------------------------------*
|
||||
* Allow previous VBlank changes to settle *
|
||||
*-------------------------------------------------------*
|
||||
moveq #5,d0
|
||||
add.l hz200.w,d0
|
||||
load_r_wait: nop
|
||||
cmp.l hz200.w,d0
|
||||
bne.s load_r_wait
|
||||
*-------------------------------------------------------*
|
||||
* Reset Videl for new register file *
|
||||
*-------------------------------------------------------*
|
||||
clr.w RSpShift.w
|
||||
*-------------------------------------------------------*
|
||||
* Lock exceptions *
|
||||
*-------------------------------------------------------*
|
||||
move.w sr,-(sp)
|
||||
or.w #0x700,sr
|
||||
*-------------------------------------------------------*
|
||||
* Load shift mode *
|
||||
*-------------------------------------------------------*
|
||||
cmp.w #2,patch_depth(a0)
|
||||
bne.s load_r_n2p
|
||||
move.b patch_RShift(a0),RShift.w
|
||||
bra.s load_r_d2p
|
||||
load_r_n2p: move.w patch_RSpShift(a0),RSpShift.w
|
||||
*-------------------------------------------------------*
|
||||
* Load line wrap *
|
||||
*-------------------------------------------------------*
|
||||
load_r_d2p: move.w patch_RWrap(a0),RWrap.w
|
||||
*-------------------------------------------------------*
|
||||
* Load sync *
|
||||
*-------------------------------------------------------*
|
||||
move.b patch_RSync(a0),RSync.w
|
||||
*-------------------------------------------------------*
|
||||
* Load clock *
|
||||
*-------------------------------------------------------*
|
||||
move.w patch_RCO(a0),RCO.w
|
||||
*-------------------------------------------------------*
|
||||
* Load mode *
|
||||
*-------------------------------------------------------*
|
||||
move.w patch_RMode(a0),RMode.w
|
||||
*-------------------------------------------------------*
|
||||
* Horizontal register set *
|
||||
*-------------------------------------------------------*
|
||||
move.w patch_RHHT(a0),RHHT.w
|
||||
move.w patch_RHBB(a0),RHBB.w
|
||||
move.w patch_RHBE(a0),RHBE.w
|
||||
move.w patch_RHDB(a0),RHDB.w
|
||||
move.w patch_RHDE(a0),RHDE.w
|
||||
move.w patch_RHSS(a0),RHSS.w
|
||||
move.w patch_RHFS(a0),RHFS.w
|
||||
move.w patch_RHEE(a0),RHEE.w
|
||||
*-------------------------------------------------------*
|
||||
* Vertical register set *
|
||||
*-------------------------------------------------------*
|
||||
move.w patch_RVFT(a0),RVFT.w
|
||||
move.w patch_RVBB(a0),RVBB.w
|
||||
move.w patch_RVBE(a0),RVBE.w
|
||||
move.w patch_RVDB(a0),RVDB.w
|
||||
move.w patch_RVDE(a0),RVDE.w
|
||||
move.w patch_RVSS(a0),RVSS.w
|
||||
*-------------------------------------------------------*
|
||||
* Restore exceptions *
|
||||
*-------------------------------------------------------*
|
||||
move.w (sp)+,sr
|
||||
*-------------------------------------------------------*
|
||||
* Re-synchronize display for new settings *
|
||||
*-------------------------------------------------------*
|
||||
move.w patch_code(a0),d1
|
||||
bsr videl_re_sync
|
||||
*-------------------------------------------------------*
|
||||
rts
|
||||
|
||||
*-------------------------------------------------------*
|
||||
* Save Videl registers *
|
||||
*-------------------------------------------------------*
|
||||
_save_r:
|
||||
*-------------------------------------------------------*
|
||||
* Get Modecode *
|
||||
*-------------------------------------------------------*
|
||||
move #-1,-(sp)
|
||||
move #87,-(sp)
|
||||
trap #14
|
||||
addq #4,sp
|
||||
*-------------------------------------------------------*
|
||||
* Register file pointer *
|
||||
*-------------------------------------------------------*
|
||||
move.l _p_str_p,a0
|
||||
*-------------------------------------------------------*
|
||||
* Save Modecode *
|
||||
*-------------------------------------------------------*
|
||||
move.w d0,patch_code(a0)
|
||||
and.w #0b0001111,d0
|
||||
move.w d0,patch_depth(a0)
|
||||
*-------------------------------------------------------*
|
||||
* Lock exceptions *
|
||||
*-------------------------------------------------------*
|
||||
move.w sr,-(sp)
|
||||
or.w #0x700,sr
|
||||
*-------------------------------------------------------*
|
||||
* Save shift mode *
|
||||
*-------------------------------------------------------*
|
||||
move.b RShift.w,patch_RShift(a0)
|
||||
move.w RSpShift.w,patch_RSpShift(a0)
|
||||
*-------------------------------------------------------*
|
||||
* Save line wrap *
|
||||
*-------------------------------------------------------*
|
||||
move.w RWrap.w,patch_RWrap(a0)
|
||||
*-------------------------------------------------------*
|
||||
* Save sync *
|
||||
*-------------------------------------------------------*
|
||||
move.b RSync.w,patch_RSync(a0)
|
||||
*-------------------------------------------------------*
|
||||
* Save clock *
|
||||
*-------------------------------------------------------*
|
||||
move.w RCO.w,patch_RCO(a0)
|
||||
*-------------------------------------------------------*
|
||||
* Save mode *
|
||||
*-------------------------------------------------------*
|
||||
move.w RMode.w,patch_RMode(a0)
|
||||
*-------------------------------------------------------*
|
||||
* Horizontal register set *
|
||||
*-------------------------------------------------------*
|
||||
move.w RHHT.w,patch_RHHT(a0)
|
||||
move.w RHBB.w,patch_RHBB(a0)
|
||||
move.w RHBE.w,patch_RHBE(a0)
|
||||
move.w RHDB.w,patch_RHDB(a0)
|
||||
move.w RHDE.w,patch_RHDE(a0)
|
||||
move.w RHSS.w,patch_RHSS(a0)
|
||||
move.w RHFS.w,patch_RHFS(a0)
|
||||
move.w RHEE.w,patch_RHEE(a0)
|
||||
*-------------------------------------------------------*
|
||||
* Vertical register set *
|
||||
*-------------------------------------------------------*
|
||||
move.w RVFT.w,patch_RVFT(a0)
|
||||
move.w RVBB.w,patch_RVBB(a0)
|
||||
move.w RVBE.w,patch_RVBE(a0)
|
||||
move.w RVDB.w,patch_RVDB(a0)
|
||||
move.w RVDE.w,patch_RVDE(a0)
|
||||
move.w RVSS.w,patch_RVSS(a0)
|
||||
*-------------------------------------------------------*
|
||||
* Restore exceptions *
|
||||
*-------------------------------------------------------*
|
||||
move.w (sp)+,sr
|
||||
rts
|
||||
|
||||
*-------------------------------------------------------*
|
||||
videl_re_sync:
|
||||
*-------------------------------------------------------*
|
||||
* Decode new modecode *
|
||||
*-------------------------------------------------------*
|
||||
btst #compat_bit,d1
|
||||
bne.s idel_re_sync_nsync
|
||||
cmp.w #none,d1
|
||||
beq.s idel_re_sync_nsync
|
||||
and.w #0b111,d1
|
||||
cmp.w #bpl2,d1
|
||||
beq.s idel_re_sync_nsync
|
||||
*-------------------------------------------------------*
|
||||
* Reset Videl for re-sync *
|
||||
*-------------------------------------------------------*
|
||||
idel_re_sync_sync: move.w RSpShift.w,d1
|
||||
clr.w RSpShift.w
|
||||
*-------------------------------------------------------*
|
||||
* Wait for at least 1 VBlank period *
|
||||
*-------------------------------------------------------*
|
||||
moveq #2,d0
|
||||
add.l vbcount.w,d0
|
||||
moveq #9,d2
|
||||
add.l hz200.w,d2
|
||||
idel_re_sync_lp: nop
|
||||
cmp.l vbcount.w,d0
|
||||
beq.s idel_re_sync_stop
|
||||
cmp.l hz200.w,d2
|
||||
bne.s idel_re_sync_lp
|
||||
*-------------------------------------------------------*
|
||||
* Restore Videl mode *
|
||||
*-------------------------------------------------------*
|
||||
idel_re_sync_stop: move.w d1,RSpShift.w
|
||||
*-------------------------------------------------------*
|
||||
idel_re_sync_nsync: rts
|
||||
|
||||
|
||||
*-------------------------------------------------------*
|
||||
.bss
|
||||
*-------------------------------------------------------*
|
||||
|
||||
_p_str_p: ds.l 1
|
||||
@@ -0,0 +1,110 @@
|
||||
#ifndef _XCB_H_
|
||||
#define _XCB_H_
|
||||
|
||||
#include "res.h"
|
||||
|
||||
/******************************************************************
|
||||
* Es folge eine Beschreibung der XCB-Struktur. Diese Struktur
|
||||
* wird vom EMULATOR.PRG angelegt, wenn dieses eine NOVA-Karte
|
||||
* im Rechner findet.
|
||||
* Zu diesem Zweck legt EMULATOR.PRG einen Cookie mit der Kennung
|
||||
* 'NOVA' an. Der Wert dieses Cookies zeigt auf die XCB-Struktur.
|
||||
* Alle Werte dieser Struktur sind, wenn nicht anders angegeben,
|
||||
* nur zum Lesen gedacht.
|
||||
******************************************************************/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
long version;
|
||||
unsigned char resolution; /* Aufl”sungsindex */
|
||||
unsigned char blnk_time; /* Bildschirmdunkelzeit */
|
||||
unsigned char ms_speed; /* Mausgeschwindigkeit */
|
||||
char old_res; /* urspr�ngliche Aufl”sung */
|
||||
|
||||
/* Aufl”sungsumschaltung */
|
||||
/* fll_ofst sollt 0UL sein */
|
||||
void (*p_chres)(RESOLUTION *res, unsigned long fll_ofst);
|
||||
short mode; /* Aufl”sungsmodus, momentan sind */
|
||||
/* folgende Werte definiert: */
|
||||
/* 0: 16 Farben */
|
||||
/* 1: 2 Farben */
|
||||
/* 2: 256 Farben */
|
||||
/* 3: 32768 Farben (Intelformat) */
|
||||
/* 4: 65536 Farben (Intelformat) */
|
||||
/* 5: 16.7 Mio. (24 Bit BGR) */
|
||||
/* 6: 16.7 Mio. (32 Bit RGBx) */
|
||||
short bypl; /* Bytes pro Bildschirmzeile, */
|
||||
/* dieser Wert muž nicht gleich */
|
||||
/* Anzahl x-Pixel * Bytes pro Pixel sein! */
|
||||
short planes; /* Anzahl Bildschirmplanes: */
|
||||
/* 1, 4, 8, 16, 24 oder 32 */
|
||||
short colors; /* Anzahl Farben, nicht benutzen */
|
||||
short hc; /* Hardcopymodus: */
|
||||
/* 0: 1 Bildpxl. = 1x1 Druckpxl. */
|
||||
/* 1: 1 Bildpxl. = 2x2 Druckpxl. */
|
||||
/* 2: 1 Bildpxl. = 4x4 Druckpxl. */
|
||||
short max_x, max_y; /* Bildschirmaufl”sung */
|
||||
/* f�r virtuelle Bildschirm- */
|
||||
/* verwaltung: */
|
||||
short rmn_x, rmx_x; /* physikalisch auf dem Monitor */
|
||||
short rmn_y, rmx_y; /* dargestellter Bereich */
|
||||
/* folgende 4 Werte d�rfen ver„ndert */
|
||||
/* werden. Dabei ist aber zu */
|
||||
/* ber�cksichtigen, daž die Werte */
|
||||
/* sinnvoll bleiben, d.h.: */
|
||||
/* v_top + v_bottom < rmx_y - rmn_y */
|
||||
/* v_left + v_right < rmx_x - rmn_x */
|
||||
short v_top, v_bottom, /* R„nder f�r virt. Speicherverwaltung */
|
||||
v_left, v_right;
|
||||
/* Zeiger auf Routine zum Farben */
|
||||
/* setzen. Index ist der Farb- */
|
||||
/* index, colors der Zeiger auf */
|
||||
/* das 3-Byte-Array mit den */
|
||||
/* Farbwerten */
|
||||
void (*p_setcol)(short index, unsigned char *colors);
|
||||
/* virtuelle Bildschirmverwaltung: */
|
||||
/* es wird getestet, ob der Punkt */
|
||||
/* (x;y) sich im dargestellten */
|
||||
/* Bildabschnitt befindet */
|
||||
/* falls nicht, wird der darge- */
|
||||
/* stellte Abschnitt so verschoben, */
|
||||
/* daž der Punkt gerade sichtbar */
|
||||
/* wird. Hierbei werden v_top, ... */
|
||||
/* ber�cksichtigt. */
|
||||
void (*chng_vrt)(short x, short y);
|
||||
/* XBIOS-Routinen f�r Graphikkarte */
|
||||
/* installieren/abschalten */
|
||||
/* on != 0: installieren */
|
||||
/* inst_xbios ist nur f�r Menu-Prog. */
|
||||
/* wie MENU.PRG und XMENU.PRG */
|
||||
/* gedacht. */
|
||||
void (*inst_xbios)(short on);
|
||||
/* Bild ein-/ausschalten */
|
||||
void (*pic_on)(short on); /* 0: Bild aus-, 1: Bild einschalten */
|
||||
/* Bildlage ver„ndern */
|
||||
/* res: Aufl”sungsstruktur */
|
||||
/* direction = 0: hor. Lage „ndern */
|
||||
/* direction != 0: ver. Lage „ndern */
|
||||
/* offset: Anzahl Einheiten, um die */
|
||||
/* verschoben werden soll */
|
||||
/* bei links oder oben positiv */
|
||||
void (*chng_pos)(RESOLUTION *res, short direction, short offset);
|
||||
void (*p_setscr)(void *adr); /* physikalische Bildschirmadresse */
|
||||
/* umsetzen. Die neue Bildschirm- */
|
||||
/* adresse muž im Speicher der */
|
||||
/* Grafikkarte liegen! */
|
||||
void *base; /* Adresse von Bildschirmseite 0 */
|
||||
void *scr_base; /* Adresse des Bildschirmspeichers */
|
||||
unsigned short scrn_cnt; /* Anzahl m”glicher phys. Bildschirm- */
|
||||
/* seiten */
|
||||
long scrn_sze; /* Gr”že eines Bildschirms in Bytes */
|
||||
unsigned char *reg_base; /* Zeiger auf I/O-Adressen, nie benutzen */
|
||||
void (*p_vsync)(void); /* wartet auf vsync */
|
||||
|
||||
char name[36]; /* Name der aktuellen Aufl”sung */
|
||||
/* folgende Variablen sind erst */
|
||||
/* ab Version 1.01 definiert: */
|
||||
unsigned long mem_size; /* Gr”že des Bildschirmspeichers in Byte */
|
||||
} XCB;
|
||||
|
||||
#endif /* _XCB_H_ */
|
||||
Reference in New Issue
Block a user