吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 11792|回复: 42
收起左侧

[原创工具] 【开源】【2016.05.21】Contra Director/魂斗罗编辑器 地图编辑版

  [复制链接]
SalHe 发表于 2016-5-21 17:40
本帖最后由 SalHe 于 2016-5-22 11:34 编辑

嗯,好吧。之前的版本都没在吾爱发布,主要是因为现在功能还不够完整,都不好意思在吾爱发布,(*^__^*)
本次主要增加了 直接从魂斗罗中提取图形 的功能,只是此功能目前对图形的解析还不够完善
在很多论坛发的帖子都已经很冷门了,可能是我Out了,哈哈。魂斗罗是小时候玩的游戏,作为蛋蛋后的楼楼确实情有独钟的爱上这个游戏了,就花了时间去搞这个了,估计对这个有感情的多数就是80,90后的前辈们咯


第一版本已经发布很久了,是2月发布的,很垃圾,代码乱得不忍直视,到了后面更新时我都觉得难以下手了,第一个版本主要是参考零晨星光前辈的源码,
他是用VB写的,好吧,不得不说,我翻译的很累 = =,前辈的代码写的也乱。。。这也是到了后期更新存在难点的原因之一
我编写时发现敌人解析问题时向CZXInc探讨,后来前辈也是很耐心的为我讲解了缘由,还做了图纸
再者就是对CXZInc前辈表示抱歉,把他的名字打成了CZXIn,一直没发现,到后来给他截图时他自个儿发现的。抱歉抱歉了

后来偶然去了 Romhacking,发现了一篇由 Trax 大神编写的魂斗罗Hack文档,通过阅读后重新编写了Contra Director
于3.29号发布第二代编辑器,重写了编辑器解析的存储机制,比如一切数据都对象化,这些更方便第三方开发(好吧,我很难相信会有人来搞这个)
还重写地图浏览的机制,改用将地图绘制成图,放在一个用于浏览图片的组件里,这个组件是我写的 ImageViewer_Ex
又新写了一个 SRect_Ex 组件,为了适配整个 UI 的风格(尽管它还是这么丑),至少证明我用心了嘛

嗯,别以为我就只看了Trax大神的那份文档,对于一些FC/NES编程知识的无知,又参考了Steven Monaco关于FC/NES图形硬件类介绍的文章
好吧,其实我看了之后照着写了一个图形绘制的源码,但是结果和预想的有出入,于是冒昧给Steven前辈发了邮件请教,前辈很友好的回了我,并详细的为我说明了,无比感激啊
有了这些基础后我又自己上网查阅了一些资料,比如关于FC/NES调色板什么的。。。


现在的剩下的问题就是关于关卡扩展、图形解压的问题,因为NES的ROM文件是有一定大小的,大的也就256KB把
扩展涉及到很多问题的,也不得不感慨当时写个游戏真心不容易,大小限制很大


说那么多,我都觉得自己有点在炫自己查了多少多少资料,请教了多少多少前辈了
其实我在写这篇帖子的时候,几乎是编写边更新附件的,因为我发现很多东西没写在附件里,这是不行滴!

上几张图(上个版本的截图):






关于介绍什么的,我直接扒 ReadMe.txt 了。。。


[Asm] 纯文本查看 复制代码
To read ReadMe.txt normally, please open it with Sublime Text.
为正常阅读 ReadMe.txt,请使用 Sublime Text 打开。

--------------------------------------------------------------------
# Contra Director
Coded by SalHe
[url=mailto:SalHe@qq.com]SalHe@qq.com[/url]
Copyright(C) SalHe, All Rights Resvered

--------------------------------------------------------------------
# Functions/功能
V20160329: 
Preview level mapping/预览地图
Preview enemy’s position/预览敌人位置

V20160507:
Edit level mapping/编辑地图

V20160521
Parsing graphics data/解析图形数据

--------------------------------------------------------------------
# Thanks/感谢
Trax & CZXIn & 凌晨星光 & Ex_DirectUI & Steven Monaco

--------------------------------------------------------------------
# Reference/参考
Trax: Contra Hacking Guide & Enemy Attributes
      http://www.bwass.org/romhack/contra/
Steven Monaco: Console Graphics Document
               http://mrclick.zophar.net/TilEd/download/consolegfx.txt

--------------------------------------------------------------------
# QAF/问题
Q: How to set language the software use?
   如何设置该软件所使用语言?
A: Open .\config\Appliction.ini, set value of item Location.Language to name of language.And the language file is in .\language\%LanguageName%.txt.You youself can write a language. Normally, there are two language files, are for Chinese and English.
   打开 .\config\Appliction.ini, 设置 Location.Language 项的值为语言名字。语言文件位于 .\language\%LanguageName%.txt。你可以自己编写语言文件。一般软件会自带两种语言文件,中文和英文。
-----------------------------------
Q: I found some question and I have some advice! 
   我发现了些问题还有点建议!
A: I'm very gald to hear it! If you've found some question or you have some advice, please let me know.
   我很高兴你发现了!如果你有任何问题或者建议,请告诉我。

--------------------------------------------------------------------
# Using guide/使用技巧
 * Some basic using methods neeedn't to be mentioned. Such as open file, save file... everybody can do them. I want to tell you some skill.
   一些基本的操作就没有说的必要了把,什么打开文件了,保存文件了。。。大家都会的。我想说的是一些小技巧。

1.How to fill many places with a same block fast: Keep Shift downed and move you mouse.
  如何快速用一个 Block 填充多处:按住 Shift 移动鼠标。

2.How to lock mapping, because I don't want to move it: Make Lock checked, it's on the left of block selected and under Edit mode.
  怎么锁定地图,因为我不想让它移来移去的:选中 锁定,它位于 选中Block 的左边,编辑模式 的下面。

--------------------------------------------------------------------
# History/历史

-----------------------------------
2016/04/02

Contra Director Preview version is completely, or nearly.
It can display level's layout and enemy's position, but can't edit.
Now Contra Director can adapt Contra of US version perfectly, other version may not, specially hacked rom.
Japanese Contra can be adapted by Contra Director, but some trouble with graphics. And I don't know whether it's caused by problem of  Contra Director-self because it's not clear to be seen.
And I want to take graphics from Contra to display, but I have never learned programming about FC/NES. Although I take it, I won't how to display it correctly.
So if you know how to do, could you please tell that? :)
Contra Director For Editing version will came out soon, or much later, because I'm getting for my ZhongKao.
Thanks for waitting! :D

Contra Director 预览版本基本完成。
现在可以显示地图布局以及敌人位置,但是不可以编辑。
现在 Contra Director 可以完美适应美版魂斗罗,其他版本可能不行,特别是修改过的。
日版魂斗罗可以被 Contra Director 适应,但是在图形上有些问题。我不知道是不是 Contra Director 自身读取的问题。
我想从魂斗罗中提取图形,但是我没学习过FC/NES编程。所以即使我提取到了,我也不知道如何正确显示。
所以,如果你了解的话可以指点一下吗? :)
Contra Director 编辑版将会不久发布,也可能很久,因为我在准备中考。
谢谢期待!:D

--------------------------------------------------------------------
2016/05/07

Contra Director Edition for Level layout is completely, or nearly.
It hasn't been updated for mostly a month since last time because of my study....:D
To update this function(edit level's layout) took some times yesterday, and I solved some bugs.
Now it can display&edit level's layout and display enemy's position.
If you want to expand Contra, I think you should use "Contra Expansion.NES". It's patched with "Contra Expansion.ips" by WinIPS. And before expanding it, you should do some works. You yourself must add section address for the level you want to expand. The function isn't implemented by me. Eh, I have too little time to do this now. So if you are interested in this, and you have ability to do it, you can ask me for source code of Contra Director(It's programmed with Easy-Language/易语言, or I will pack source code into attachment).
And my troubles about taking graphics from Contra, some of them are solved. Rest of them are definition of color of cell. I don't how to connect cell with palette. I hope you can help me:)

Contra Director 地图编辑版基本完成。
几乎一个月没写了,主要因为学习....:D
昨天花了些时间来更新这个功能(编辑地图布局),我还解决了一些bug。
现在可以显示&编辑地图布局,显示敌人位置。
如果你想扩展魂斗罗,我觉得你应该使用“Contra Expansion.NES”。这是用WinIPS打的补丁,补丁文件是“Contra Expansion.ips”。在扩展以前,你还要干点事儿。你必须手动为你想扩展的关卡添加关卡页(Section)地址。这个功能我没去实现。额,我时间不够,暂时就没法去做了。如果你对这个感兴趣,并且有能力完成的话,可以找我要源码的(是用 Easy-Language/易语言 写的,可能我会把源码放在附件里的)。
关于我从魂斗罗提取图形的问题,其中一些已经解决了。剩下的问题是Cell的颜色的定义。我不晓得怎么把调色板和cell联系起来。希望你能帮助我:)

--------------------------------------------------------------------
2016/05/13

The function updated this time is directly parsing graphics from Contra ROM file.
But it's not enough perfect. The main problem is on uncompressing graphics data for PPU.
And I will try to solve it. But in short time, I can't do it.
Maybe some months later I can complete it, because of something...
For using this function, open Contra firstly, and click my head.
Eh, it's like a rabbit, isn't it?
Maybe you still don't konw what it is, and now, I say it in a piece of words.
It's on left-up corner of Contra Director, And there is a word "SalHe" written on the head.
I think you must know where it is. If not, you are really foolish :D
Hah, that is a joke, don't think more.
And the result parsed is saved in .\Results.

本次更新功能是直接从魂斗罗的ROM文件中提取图形。
但是这个功能还不够完善,主要问题出在解压图形数据到PPU上。
我会去解决的,但是短时间内是不行的了。
估计数月后我可以完成,因为一些事情要忙...
使用方法是,先打开魂斗罗,然后点击我的头像。
额,看起来像只兔子,不是么?
也许你还是不晓得它是什么鬼,我就用一句话说好了。
它在 Contra Director 的左上角,有个单词“SalHe”被写在上面。
我想你肯定知道它在哪了。如果还不知道,那你真够笨的 :D
哈,开个玩笑了,别当真哈。
解析的结果存放在 .\Results 里。



[Asm] 纯文本查看 复制代码
--------------------------------------------------------------------
2016/05/22

Today when I'm optimizing algorithm of uncompressing graphics data, I found why parsing graphics fail at last...
That's interesting, it's a pointer covertion problem. I forgot to add 1 for new PPU address.
Follow is code fixed:
  ppuOffset = 合并整数 (取字节集数据 (Contra, #短整数型, ConvertPointer (ptr)), 0) + 1 ' Yes. Where it's fixed is " + 1" at the end of code.
But now I want not to release it. Because the function updated is only one and it's for a bug fixing.
Okay, I think I am closer to success. And later I will go to school for night lesson.
Now there is some problem on drawing blocks. It's about colors(palette). 
And the palette I used is for Level 1. So the blocks of the other levels are different from original game in colors...
After that, main task is editting enemy. Eh, I will do it, maybe several months later...:D
The students are hard...Hah.

今天当我在优化图形解压算法时,我终于发现图形解析失败的问题了...
说起来也很有趣,就是个指针转换问题。我忘了给新PPU地址加1了。
修复后的代码是酱紫的:
  ppuOffset = 合并整数 (取字节集数据 (Contra, #短整数型, ConvertPointer (ptr)), 0) + 1 ' 嗯,没错,就是在屁股那里多了个“ + 1”。
现在我还不想发布它,因为更新的功能就一个而且还是修复bug。
嗯,我觉得我离成功又进了。过会儿我就得去学校准备晚自习了。
现在在绘制Blocks上还有点问题。和颜色(调色板)有关。
我用都的是1关的调色板,所以别的关卡的Blocks看起来和原游戏的颜色不一样...
这之后的话,首要任务就是编辑敌人了。额,估计几个月后我会去弄的把...:D
学生真苦啊...哈哈。


我知道你们有文字恐惧症 ==。。。
成品: ContraDirector[Released].7z (1007.86 KB, 下载次数: 292)
源码: ContraDirector[Source-Code].7z (405.92 KB, 下载次数: 72)

免费评分

参与人数 22热心值 +22 收起 理由
冰炎梦幻 + 1 做的好,hack圈子就需要这样的人才
月华漫步 + 1 这个太牛了 支持
1131195092 + 1 谢谢@Thanks!
yu490025278 + 1 厉害 好评!!
wuxianbo + 1 支持
雨中的传说 + 1 这感觉真好
motodefy + 1 我很赞同!
zy1234 + 1 童年的经典,必需加分
死月 + 1 = =小时候的梦想自己编辑地图
dry + 1 操,不为什么的只为经典加分。童年又回来了。
coollwll + 1 谢谢@Thanks!
fengwutianxiaan + 1 能不能再发个作死gif?哈哈哈哈~
王莽 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
SHAYU77777777 + 1 我很赞同!
Hmily + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
逆°风草 + 1 欢迎分析讨论交流,吾爱破解论坛有你更精彩!
fshx2008 + 1 谢谢@Thanks!
xouou + 1 流弊
pyq919 + 1 我很赞同!
饺子不过好吃 + 1 谢谢@Thanks!
15766328312 + 1 谢谢@Thanks!
zjf6311 + 1 谢谢@Thanks!

查看全部评分

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

 楼主| SalHe 发表于 2016-5-22 12:31
我的永硕,刚注册的
前缀为 SalHe。
zjf6311 发表于 2016-5-21 17:47
15766328312 发表于 2016-5-21 18:29
lcmystery 发表于 2016-5-21 18:55
顶个,小时候经常玩的。
hudimail 发表于 2016-5-21 19:32
不错,有空编辑一个玩玩!
dpl123 发表于 2016-5-21 19:39
小时候玩的
lizhipei78 发表于 2016-5-21 20:04
还是无限命的好玩
haoke138 发表于 2016-5-21 20:34
不错,支持一下
左岸麦田 发表于 2016-5-21 21:57
经典游戏。
ghshr521 发表于 2016-5-21 21:57 来自手机
支持楼主多多发新帖
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 提醒:禁止复制他人回复等『恶意灌水』行为,违者重罚!

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-5-21 14:56

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表