用FC计算生肖(THE LUNAR YEAR MASCOTS OF CHINA)

Chinese-language board. 为NES/FC开发商的中国语言论坛 | 為NES/FC開發商的中國語言論壇

Moderator: Moderators

Post Reply
User avatar
fogota
Posts: 27
Joined: Sun Feb 15, 2009 8:23 am
Contact:

用FC计算生肖(THE LUNAR YEAR MASCOTS OF CHINA)

Post by fogota » Sat Apr 11, 2009 10:55 am

FC(任天堂NES)自编程序.创意作品,首次将FC当成是小程序使用.
全英文版.全文字程序.输入年份计算生肖

Do you want know what Mascots in the Lunar Year of China?
Tell me a year which you want known. And I'll tell you.

Here,I use FC.

Download here

now , new download : http://fogota.ys168.com/
Last edited by fogota on Fri Mar 10, 2017 9:50 pm, edited 3 times in total.

User avatar
Memblers
Site Admin
Posts: 3770
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Post by Memblers » Sat Apr 11, 2009 1:23 pm

That's good, for a first program it does a lot. There are some problems with the PPU. I tested it with NEStopia and FCEU.

If you want, I'll review the code and help you fix all the problems.

User avatar
fogota
Posts: 27
Joined: Sun Feb 15, 2009 8:23 am
Contact:

Post by fogota » Sat Apr 11, 2009 8:52 pm

With your help, too much honor to it.

I'm using the NBasic Compiler.

Here the asm & NBasic code.

http://www.uushare.com/user/fogota/files/1487930

my friends at NET ,they are going to add some pritrues to it.
Last edited by fogota on Mon Apr 13, 2009 6:16 am, edited 3 times in total.

User avatar
fogota
Posts: 27
Joined: Sun Feb 15, 2009 8:23 am
Contact:

Post by fogota » Sat Apr 11, 2009 9:03 pm

It's not my first program.It's the second.

THe first program is GREEDY SNAKE.

HA..HA.. at the same net-disk.

Download here
http://www.uushare.com/group/10085/topic/11555

http://www.uushare.com/user/fogota/files/1131553

User avatar
Memblers
Site Admin
Posts: 3770
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Post by Memblers » Fri Apr 24, 2009 11:06 am

Sorry about the slow reply.

Greedy Snake is pretty cool, I only tested it on emulators so far, but it seems to work there. One misspelling is that it says "GAME LEVE" instead of "GAME LEVEL".

I've never used nbasic so it confuses me a bit, so I'm not sure of what to change to fix the graphics in the Lunar Year program. One problem I did see was waiting for vblank end (with LDA $2002 / BMI). That won't work, because the vblank flag is cleared as soon as it's read.

tepples
Posts: 21752
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples » Fri Apr 24, 2009 11:30 am

Most of the time, you don't need to wait for the end of vblank. You can just set up the scroll registers, run your outside-of-vblank code, and wait for the NMI handler to run again.

Historical note: Some early homebrew developers assumed that the NES's vblank flag behaved like Nesticle's. In Nesticle, if you don't use NMI, you have to wait for vblank to end then wait for it to start again; otherwise, your main loop might run twice if it finishes while still in vblank.

Platform note: The Game Boy Advance's vblank flag operates like Nesticle's, but the vblank interrupt is still preferred there because the GBA CPU has a "wait for next interrupt" instruction that lowers CPU power consumption to near zero.

Exception: It is possible to wait for the end of vblank, and you may have to do that if you're using forced blanking at the top of the screen. The right way involves triggering a sprite 0 hit and waiting for that flag to become 0.

"GAME LEVE" might be the 8 sprites limitation.

User avatar
fogota
Posts: 27
Joined: Sun Feb 15, 2009 8:23 am
Contact:

Post by fogota » Sun Apr 26, 2009 8:43 am

Memblers wrote:Sorry about the slow reply.

Greedy Snake is pretty cool, I only tested it on emulators so far, but it seems to work there. One misspelling is that it says "GAME LEVE" instead of "GAME LEVEL".

I've never used nbasic so it confuses me a bit, so I'm not sure of what to change to fix the graphics in the Lunar Year program. One problem I did see was waiting for vblank end (with LDA $2002 / BMI). That won't work, because the vblank flag is cleared as soon as it's read.
I'm sorry for my English.I'll change it "GAME LEVEL".

And what do you use?

My nbasic come from Mr.Bob Rost(http://bobrost.com/nes/)

I'm learning his code. I just try to used the "wait for vbland end".

And it looks like good. So I just use it. I'm just learning...

My games all can run in my MP4 what it has a emulator .

Image
Last edited by fogota on Sun Apr 26, 2009 9:16 am, edited 2 times in total.

User avatar
fogota
Posts: 27
Joined: Sun Feb 15, 2009 8:23 am
Contact:

Post by fogota » Sun Apr 26, 2009 8:54 am

tepples wrote:Most of the time, you don't need to wait for the end of vblank. You can just set up the scroll registers, run your outside-of-vblank code, and wait for the NMI handler to run again.

Historical note: Some early homebrew developers assumed that the NES's vblank flag behaved like Nesticle's. In Nesticle, if you don't use NMI, you have to wait for vblank to end then wait for it to start again; otherwise, your main loop might run twice if it finishes while still in vblank.

Platform note: The Game Boy Advance's vblank flag operates like Nesticle's, but the vblank interrupt is still preferred there because the GBA CPU has a "wait for next interrupt" instruction that lowers CPU power consumption to near zero.

Exception: It is possible to wait for the end of vblank, and you may have to do that if you're using forced blanking at the top of the screen. The right way involves triggering a sprite 0 hit and waiting for that flag to become 0.

"GAME LEVE" might be the 8 sprites limitation.
Thanks a lot!!

I'll learning....

My friend on China,Win for my GREEDY SNAKE.
Image

User avatar
Memblers
Site Admin
Posts: 3770
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Post by Memblers » Sun Apr 26, 2009 9:20 am

I use cc65 http://www.cc65.org/, but I've also worked with many other assembler programs. cc65 has a C compiler, but I never use that part. I have seen a few good programs use the nbasic compiler.

Really the best way to update VRAM, is to use the NMI interrupt. But since that's in assembly I don't know how (or if) nbasic handles it.

tepples had mentioned NESticle, it sounds like the emulator in the MP4 device may be similar. Best described as permissive, you can get away with a lot of things the hardware won't allow. I wrote many programs that worked on NESticle but not other emulators or the real system when I first started out (since NESticle was the only emulator to test it on).

I would advise using an emulator like Nestopia http://nestopia.sourceforge.net/ for testing. Often I'll add it into the .bat file just for convenience. And for the program, try to keep all updates to VRAM as short as possible and only do it immediately after vblank is detected. It should work then. By VRAM accesses I mean anything to the $2006 and $2007 registers (which is 8198 and 8199 in nbasic).

As the program gets more complex, it helps to write VRAM updates into a buffer in RAM first, then copy it all during vblank.

You've done good at learning this stuff, and your english is pretty good, by the way. It's pretty cool to create a program from nothing. :)

User avatar
fogota
Posts: 27
Joined: Sun Feb 15, 2009 8:23 am
Contact:

Post by fogota » Tue Apr 28, 2009 6:23 am

Memblers wrote:I use cc65 http://www.cc65.org/, but I've also worked with many other assembler programs. cc65 has a C compiler, but I never use that part. I have seen a few good programs use the nbasic compiler.

Really the best way to update VRAM, is to use the NMI interrupt. But since that's in assembly I don't know how (or if) nbasic handles it.

tepples had mentioned NESticle, it sounds like the emulator in the MP4 device may be similar. Best described as permissive, you can get away with a lot of things the hardware won't allow. I wrote many programs that worked on NESticle but not other emulators or the real system when I first started out (since NESticle was the only emulator to test it on).

I would advise using an emulator like Nestopia http://nestopia.sourceforge.net/ for testing. Often I'll add it into the .bat file just for convenience. And for the program, try to keep all updates to VRAM as short as possible and only do it immediately after vblank is detected. It should work then. By VRAM accesses I mean anything to the $2006 and $2007 registers (which is 8198 and 8199 in nbasic).

As the program gets more complex, it helps to write VRAM updates into a buffer in RAM first, then copy it all during vblank.

You've done good at learning this stuff, and your english is pretty good, by the way. It's pretty cool to create a program from nothing. :)
Oh, yes, you're right. My idae is same with you.

But I'm lazy,,,,so have no time to reseach the interrupt.

I know that the VRAM accesses must be end , at the end of vblank.

So I use a lot of codes to wait the end of vblank.

The tools is too lack to development. I just have Nbasic and a few of emulator.

My codes often give me some wrong message what I do not understand.

I busy modifing my codes.

Yave
Posts: 22
Joined: Sun Jan 19, 2014 6:15 pm

Re: 用FC计算生肖(THE LUNAR YEAR MASCOTS OF CHINA)

Post by Yave » Sat Nov 01, 2014 4:47 pm

计算生肖喝了,uushare早挂了……

这2009年的贴,真的好老!
然后到现在不见几个新的,可见nesdev的中文专区是有多么冷清啊!

User avatar
fogota
Posts: 27
Joined: Sun Feb 15, 2009 8:23 am
Contact:

Re: 用FC计算生肖(THE LUNAR YEAR MASCOTS OF CHINA)

Post by fogota » Fri Mar 10, 2017 9:46 pm

Yave wrote:计算生肖喝了,uushare早挂了……

这2009年的贴,真的好老!
然后到现在不见几个新的,可见nesdev的中文专区是有多么冷清啊!
新的下载 http://fogota.ys168.com/

Post Reply