【发布时间】:2023-07-09 11:06:01
【问题描述】:
最近几天因为生病而无聊透顶,我决定尝试挖掘一些旧代码。我可以找到一些我写的古代 Atari ST 东西的二进制版本,但我找不到任何来源。我确实设法从传说中的旧 x2ftp 站点的存档中挖掘出我很多个月前在 ASM 中编写的旧 ModeX 库:
http://ftp.lanet.lv/ftp/mirror/x2ftp/msdos
过去的爆炸 :-)
; Actually Sticks Us Into ModeX - With 240 Scanlines Per Page
; Set The Variable LSCAN To The Virtual Scanline Length You Want
; Trashes AX, CX, DX, DS, SI
; Shouldn't Matter Though As This Should Be The First Thing You Call!
Set_X_240 PROC
Call Set_Graph ; Set Mode 13h
mov dx, Seq_Port
mov ax, 00604h ; Index 4 (Memory Mode Reg.) In AL
; Bit 3 = Chain 4
out dx, ax ; Kill Chain 4 Mode
mov ax, 00100h ; Index 0 (Reset Reg.) In AL
out dx, ax ; Reset Syncronous (At End Of Cycle)
dec dx ; Change Port
dec dx ; To Misc. S--t Port :)
mov al, 11100011b
out dx, al ; Sets 480 Line Mode, 25Mhz Dot Clock
inc dx ; Change Port
inc dx ; Back To Sequencer Port
mov ax, 00300h
out dx, ax ; Restart Controller
mov dx, Crtc_Port
mov al, 011h
out dx, al ; Select Index 11h (Vert.Retrace End)
inc dx ; Data Port
in al, dx ; Read In Current Bit Mask
and al, 07Fh ; 01111111 - Clear Top Bit (Write Protect)
out dx, al ; Un-Write Protect Index 0-7 Of CRTC Reg.
dec dx ; Restore Port To Index
mov ax, seg CRTC_Data_240 ; Address Of Our CRTC Data
mov ds, ax
mov si, offset CRTC_Data_240
mov cx, LCRTC_Data_240 ; Length Of Data
repz outsw ; Chuck It At The Port
mov ax, lscan
shr ax, 3 ; Number Of Words Per Scan Line
mov ah, al ; Into AH
mov al, 013h ; Port Index 013h - Logical Screen Width
out dx, ax
mov NScan, 240
Call Set_Pages
ret
Set_X_240 ENDP
还有其他人想让自己看起来很老,并发布一些旧学校代码吗? :-) 很遗憾,我的 68000 ASM 东西仍然没有,尽管我现在可能都认不出来了!
啊.. 回忆:-)
【问题讨论】:
-
我个人的公理是这样的:如果您可以查看旧代码而不畏缩,那么您就没有成为程序员。
-
好吧,我不会说我的旧代码让我畏缩...... -)
-
我会发布一些东西,但我没有带 USB 连接器的卡式录音机。
-
我对投票结束这个老问题感到有点难过,特别是因为我确实有 some nice old 68k assembly code 在身边,但很明显 outside the scope of Stack Overflow 今天。我确实希望,即使关闭,我们也可以保留它,作为一个历史提醒,让我们想起 SO 是一个更加健谈和开放的地方。
标签: assembly legacy-code 68000