Programming 板


LINE

※ 引述《kingstong (卍解-天锁斩月)》之铭言: : 我只知道要制作游戏需先在电脑绘画图档(单机游戏) : 然後再利用程式将图档与程式做连结....... : 有人是使用DirectX,但我想知道在dos时代时 : 到底是怎麽写游戏.....就像大宇的轩辕剑 : 或是仙剑奇侠传等...还望高手赐教,感激不尽 经典游戏,金庸群侠传总玩过吧 http://goo.gl/oYYUR 这里有原始码,用 C 语言写,一样从 main 开始 int main(int argc, char* argv[]) #endif { srand(clock()); InitialFont(); InitialVedio(); InitialAudio(); Start(); Quit(); return 0; } 然後这个专案画图是用 SDL 画的:http://goo.gl/Lzugi ==== 而 DOS 基本就两种显示模式,文字模式、绘图模式。 平常刚开玩机,就文字模式,这时只能显示些文字,然後你要画图就是用 CPU 指令 int 呼叫中断,进入绘图模式,进入後就可以有比如 320 X 200 像素 然後你画图时就是一个像素一个像素去设定,比如 X 座标 = 10, Y 座标 = 20 时 颜色要采用比如黄色... DOS 绘图范例程式码:http://ubuntuone.com/p/17bB/ ==== 补充:备份一下上面网址内的程式码,以免砍档後看不到 Plotting a pixel An easy way to plot a pixel is by using function 0x0C under BIOS interrupt 0x10. For this function, set CX and DXto the pixel xand ylocation. The color displayed depends on the value in AL. See Table I for a list of common colors. union REGS regs; regs.h.ah = 0x0C; /* function 0Ch = pixel plot */ regs.h.al = color; regs.x.cx = x; /* x location, from 0..319 */ regs.x.dx = y; /* y location, from 0..199 */ int86(0x10,&regs,&regs); Plotting a pixel quickly typedef unsigned char byte; byte far *VGA = (byte far*)0xA0000000L; unsigned short offset; /* ... */ offset = 320*y + x; VGA[offset] = color; --



※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 124.8.138.160 ※ 编辑: purpose 来自: 124.8.138.160 (01/24 21:10)
1F:推 Bencrie:那个时代记忆体应该比较难搞吧 XD 114.34.236.197 01/24 23:56
2F:→ MOONRAKER:在DPMI/VCPI之前都是恶梦 114.45.207.187 01/25 22:54







like.gif 您可能会有兴趣的文章
icon.png[问题/行为] 猫晚上进房间会不会有憋尿问题
icon.pngRe: [闲聊] 选了错误的女孩成为魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一张
icon.png[心得] EMS高领长版毛衣.墨小楼MC1002
icon.png[分享] 丹龙隔热纸GE55+33+22
icon.png[问题] 清洗洗衣机
icon.png[寻物] 窗台下的空间
icon.png[闲聊] 双极の女神1 木魔爵
icon.png[售车] 新竹 1997 march 1297cc 白色 四门
icon.png[讨论] 能从照片感受到摄影者心情吗
icon.png[狂贺] 贺贺贺贺 贺!岛村卯月!总选举NO.1
icon.png[难过] 羡慕白皮肤的女生
icon.png阅读文章
icon.png[黑特]
icon.png[问题] SBK S1安装於安全帽位置
icon.png[分享] 旧woo100绝版开箱!!
icon.pngRe: [无言] 关於小包卫生纸
icon.png[开箱] E5-2683V3 RX480Strix 快睿C1 简单测试
icon.png[心得] 苍の海贼龙 地狱 执行者16PT
icon.png[售车] 1999年Virage iO 1.8EXi
icon.png[心得] 挑战33 LV10 狮子座pt solo
icon.png[闲聊] 手把手教你不被桶之新手主购教学
icon.png[分享] Civic Type R 量产版官方照无预警流出
icon.png[售车] Golf 4 2.0 银色 自排
icon.png[出售] Graco提篮汽座(有底座)2000元诚可议
icon.png[问题] 请问补牙材质掉了还能再补吗?(台中半年内
icon.png[问题] 44th 单曲 生写竟然都给重复的啊啊!
icon.png[心得] 华南红卡/icash 核卡
icon.png[问题] 拔牙矫正这样正常吗
icon.png[赠送] 老莫高业 初业 102年版
icon.png[情报] 三大行动支付 本季掀战火
icon.png[宝宝] 博客来Amos水蜡笔5/1特价五折
icon.pngRe: [心得] 新鲜人一些面试分享
icon.png[心得] 苍の海贼龙 地狱 麒麟25PT
icon.pngRe: [闲聊] (君の名は。雷慎入) 君名二创漫画翻译
icon.pngRe: [闲聊] OGN中场影片:失踪人口局 (英文字幕)
icon.png[问题] 台湾大哥大4G讯号差
icon.png[出售] [全国]全新千寻侘草LED灯, 水草

请输入看板名称,例如:Soft_Job站内搜寻

TOP