![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-09-14 23:55 |
47,812 topics / 349,917 posts / today 0 new / 48,268 members |
| DOS开发编程 & 发展交流 (开发室) » [Original] DouDiZhu Script Technical Preparation - Color Output SYBC.com |
| Printable Version 5,652 / 19 |
| Floor1 sl543001 | Posted 2010-02-28 18:39 |
| 中级用户 Posts 225 Credits 499 | |
|
I'm working hard to develop a CMD version of Dou Di Zhu (Chinese poker), and there are many technical preparations to do.
Because I plan to use a full-color game interface, so I need a small COM to output colored characters. Initially, I used tit.com, and then developed sybc.com based on it. And used sybc.com to write a series of sample codes. Currently, the complete interface of Dou Di Zhu can be realized with sybc.com. The game code and version 1.1.11 of sybc are on floor 6 The latest version 1.1.21 is on floor 9 The latest version 1.1.31 is on floor 12 Recruiting experts and novices to join the development together QQ group: 3401238 http://www.cn-dos.net/forum/viewthread.php?tid=50331&fpage=1 [ Last edited by sl543001 on 2010-4-3 at 03:23 ] Attachments sybc.rar (1.06 KiB) sybc参数详解.gif (17.45 KiB) ddz59.GIF (23.49 KiB) |
|
| Floor2 awangwjf | Posted 2010-02-28 19:53 |
| 新手上路 Posts 3 Credits 7 | |
|
Hope to see V1.0 soon.
|
|
| Floor3 sl543001 | Posted 2010-03-01 11:20 |
| 中级用户 Posts 225 Credits 499 | |
|
Modified and updated the code, slightly modified the grammar, and changed the screenshot to a playing card!
|
|
| Floor4 sl543001 | Posted 2010-03-01 11:28 |
| 中级用户 Posts 225 Credits 499 | |
|
The code used to display a column of playing cards in the screenshot of floor 1:
|
|
| Floor5 sl543001 | Posted 2010-03-02 17:44 |
| 中级用户 Posts 225 Credits 499 | |
|
Is planning to modify the parameter entry and calling method, breaking through the 124 parameter limit
|
|
| Floor6 sl543001 | Posted 2010-03-04 12:01 |
| 中级用户 Posts 225 Credits 499 | |
|
The plan to modify the parameter entry is postponed to be solved in the sybn Dll. Currently, a new method is found to solve the problem. In the new version of sybc, the meanings of ";:" and ";" in the parameters are swapped. Because the usage rate of the original ";:" is higher than that of ";", so a little code is saved. Just finished changing the color of the number at the lower right corner.
The斗地主 script used in the screenshot Can only be looked at, still cannot be played. [ Last edited by sl543001 on 2010-3-4 at 12:18 ] Attachments ddz.rar (1.68 KiB) |
|
| Floor7 qinchun36 | Posted 2010-03-04 14:33 |
| 高级用户 Posts 400 Credits 609 | |
|
.......
Oh, different lines are like different mountains. I don't understand it, and there's no chance to learn assembly anymore. I can only support it spiritually |
|
| Floor8 sl543001 | Posted 2010-03-06 09:56 |
| 中级用户 Posts 225 Credits 499 | |
|
No need to understand the principle, just be able to use it.
I will release the DEBUG version when sybc is developed to a certain extent. At that time, the full-color output without third parties can be realized! |
|
| Floor9 sl543001 | Posted 2010-03-06 16:38 |
| 中级用户 Posts 225 Credits 499 | |
|
The new version sybc 1.1.21 already supports the choice function. The method is to run it without adding any parameters.
Now release the debug version of sybc to generate code: [ Last edited by sl543001 on 2010-3-6 at 16:40 ] Attachments ddz59.GIF (18.95 KiB) |
|
| Floor10 sl543001 | Posted 2010-03-20 15:19 |
| 中级用户 Posts 225 Credits 499 | |
|
Because SYBC is designed to be embedded in scripts, you can release it from the script to memory directly instead of generating the SYBC.COM file on the disk. It can also be run in memory. Of course, if you want, it can also be used like a general third-party tool.
Well, everyone first needs screenshots and download addresses. The screenshots are below, which are real pictures of the cmd script! As for the download address, since it is embedded, why download it? Just save the following code as a cmd and run it to generate SYBC.com (this code version 1.1.21, update date 2010-3-10) ------------------------------------------------------------------------------- Well, now everyone should have the SYBC.com file. If not, generate one. The next question is how to use SYBC. SYBC has two types of grammars: basic and advanced (the two only differ in speed, and the final effects are the same). It can be run in the form of the SYBC.com file or directly in memory (the latter is slightly faster). ------------------------------------------------------------------------------- Before using SYBC, initialization is required (especially for Win2000/XP). The initialization method is very simple. First, if you want to use Chinese, you need to add ""(CHCP 437 &GRAFTABL 936)>NUL" at the beginning of your code. Then you need to run SYBC without parameters once, and the initialization is completed after the user presses any key.: (There is no prompt, so it is recommended that everyone better use echo to inform the user to press any key) ------------------------------------------------------------------------------- Basic grammar: SYBC positioncolorcontent SYBC 10303$F1SYBN#s Position: 5-digit number, the 2nd and 3rd digits are the row number, and the 4th and 5th digits are the column number Color: 2 hexadecimal numbers preceded by $, the same as the color command Content: Any string (note that do not use $#; three symbols to avoid conflicts) #number: No content, keep the original content of this position and only change the color $number: Allow multiple $numbers, respectively control the color of the following characters ------------------------------------------------------------------------------- Using the basic grammar can achieve all the effects of SYBC. If you feel that the speed is not satisfactory, you can use the advanced grammar, combine multiple lines of basic grammar into one line of advanced grammar to reduce the number of calls to speed up. No matter which grammar is used, the time for each call to SYBC is about 0.01 seconds, and the bottleneck is the response speed of the hard disk. In addition, using the embedded call, skipping the disk and directly running SYBC can further improve the speed, but the code readability will be sacrificed. ------------------------------------------------------------------------------- Advanced grammar: [Grammar diagram example 3] SYBC 10303$F1SYBN;2010 The effect is the same as SYBC 10303$F1SYBN SYBC 10403$F12010 Semicolon is a line break character, and you can start a new line from the starting column of the previous line. If you do not use a line break character and write a very long string, it will naturally wrap like echo. [Grammar diagram example 4] SYBC 10303$F1SYBN;:10401$F12010 The effect is the same as SYBC 10303$F1SYBN SYBC 10401$F12010 Semicolon colon: The effect is similar to the & symbol in the script, which can connect two SYBC commands together. In this way, you can almost combine all consecutive SYBC commands into one line, and the speed will be much faster. -------------------------------------------------------------------------------- However, everyone should pay attention that the parameters of the com program have a length limit. The theoretical length is 127, and the actual available length is 124. If it exceeds 124, it cannot be executed! Of course, if you use the subsequent embedded call, there is no such limit! -------------------------------------------------------------------------------- Embedded call: It is convenient to call the com program using DEBUG. The SYBC.com generated earlier used DEBUG. We just need to modify it slightly to be used for embedded calls. First, save the code of SYBC.com in the variable SYBCOM in hexadecimal formThen save the DEBUG instructions in the variable VNote that 10 refers to the hexadecimal value of the parameter length. In version 1.1.21, it is no longer used, so just write it as it is or write other hexadecimal values. "10303$F1SYBN2010" is the parameter. Remember to add colons on both sides. The parameter length limit here is about 65 bytes. Finally, call them--------------------------------------------------------------------------------------------------------- Of course, you still haven't broken through the 124 parameter limit, but instead the limit is reduced to about 65 bytes. How to break through the limit? Modify the value of variable V.You don't need to care why it is written like this. Just know that you can segment the parameters, each segment is less than 65 bytes, and write it in quotes. You can write infinitely many DB "XXXXXXXX". Note that the last one should be added with 0D, and don't forget the space before 0D. For problems, contact QQ: 354324773 |
|
| Floor11 sl543001 | Posted 2010-03-31 18:50 |
| 中级用户 Posts 225 Credits 499 | |
|
The latest SYBC 1.1.31 supports directly reading variables in memory as program parameters. It greatly improves the usage efficiency, and the display time for the same content is reduced by more than one third. Take斗地主 (Dou Di Zhu, a card game) as an example: the refresh time is reduced from 48 to 27. SYBC 1.1.31 is being tested...
Attachments ddz61.GIF (20.14 KiB) |
|
| Floor12 sl543001 | Posted 2010-03-31 18:57 |
| 中级用户 Posts 225 Credits 499 | |
|
### Version 1.1.31 Memory Call Module Demo Code
Insert the content after SYBC into the script. After initialization, you can use "call :SYBC parameter" The parameter can be almost infinitely long, as long as it does not exceed 64K (it's difficult to make the parameter exceed 64K anyway) [ Last edited by sl543001 on 2010-3-31 at 19:00 ] |
|
| Floor13 sl543001 | Posted 2010-04-03 03:25 |
| 中级用户 Posts 225 Credits 499 | |
|
1.1.31 preliminary test found no BUG, and is planning to add new functions: mouse support, delay
|
|
| Floor14 sl543001 | Posted 2010-04-18 23:09 |
| 中级用户 Posts 225 Credits 499 | |
| Floor15 sl543001 | Posted 2010-04-19 21:28 |
| 中级用户 Posts 225 Credits 499 | |
|
Line-by-line comment on part of the assembly source code:
|
|
| 1 2 Next |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |