Search found 139 matches

by tschak909
Tue Jul 25, 2017 12:21 am
Forum: NESdev
Topic: divide by 10 and divide by 6 using bit shifts+addition
Replies: 11
Views: 3509

divide by 10 and divide by 6 using bit shifts+addition

Does anyone happen to have a general algorithm for dividing by 10 and by 6 using shifts/addition? debating on whether to go this direction, or to code it into a table...

-Thom
by tschak909
Sun Jul 23, 2017 10:28 am
Forum: Homebrew Projects
Topic: WIP: Wizard of Wor
Replies: 165
Views: 78917

Re: WIP: Wizard of Wor

Scoring now implemented. I had a bit of a trip trying to be a bit too clever with the algorithm, https://www.youtube.com/watch?v=tsEfDJwiPNY but it's there, and now I'm implementing the sprite structure, a simple array of 8 entries with 5 elements each (40 bytes) containing: /** * 8 objects on scree...
by tschak909
Sun Jul 23, 2017 9:28 am
Forum: Homebrew Projects
Topic: Score add in C
Replies: 8
Views: 4727

Re: Score add in C

lidnariq wrote:Have you looked into storing your 'unpacked BCD' representations little-endian? It would let you add different sizes of numbers easily, rather than requiring everything in 6 bytes.
That's a definite possibility, for now it's on my list of crunching bytes to save space.

-Thom
by tschak909
Sun Jul 23, 2017 3:56 am
Forum: Homebrew Projects
Topic: Score add in C
Replies: 8
Views: 4727

Re: Score add in C

Correct on both counts, have fixed this, and will post up in the wiki. :)

-Thom
by tschak909
Sat Jul 22, 2017 11:43 pm
Forum: Homebrew Projects
Topic: Score add in C
Replies: 8
Views: 4727

Re: Score add in C

I invented another way (for signed 16-bit numbers into decimal), which however requires many more ROM tables and special pattern tables. I have not compared the speed However, in some cases you can just work in base 10 or base 100 for scoring anyways and it will work, and you do not need to convert...
by tschak909
Sat Jul 22, 2017 8:03 pm
Forum: Homebrew Projects
Topic: Score add in C
Replies: 8
Views: 4727

Re: Score add in C

Omegamatrix wrote a 16 bits to 5 digits converter that finishes in less than 200 cycles. It's written in assembly language, but if you ask nicely, someone can adapt its calling convention to work when called from C code compiled by cc65. Ah, Omegamatrix is here too. I've known him for over a decade...
by tschak909
Sat Jul 22, 2017 12:36 pm
Forum: Homebrew Projects
Topic: Score add in C
Replies: 8
Views: 4727

Score add in C

This one is putting me in the fetal position, because I am deliberately trying to avoid the division and modulo that is used in the canonical algorithms for converting numbers to an ASCII string, e.g. char* itoa(int num, char* str, int base) { int i = 0; bool isNegative = false; /* Handle 0 explicit...
by tschak909
Wed Jul 19, 2017 7:57 pm
Forum: Homebrew Projects
Topic: Need input for view logic for Dodgeball
Replies: 13
Views: 6587

Re: Need input for view logic for Dodgeball

I needed a tiny respite from grinding through the score output code, and did a quick conversion and touch-up of the ADAA logo for the middle of the Dodgeball court, looks GREAT in multiple background colors! http://i.imgur.com/tvNkPhJ.png http://i.imgur.com/I22SQYX.png http://i.imgur.com/uvbC2aN.png...
by tschak909
Wed Jul 19, 2017 6:36 pm
Forum: Homebrew Projects
Topic: Need input for view logic for Dodgeball
Replies: 13
Views: 6587

Re: Need input for view logic for Dodgeball

Well, in 1-2 player mode:

With six metasprites on each side:

B selects player
A throws

any player not selected takes on AI to throw at nearest opposing player.

no?

-Thom
by tschak909
Wed Jul 19, 2017 4:36 pm
Forum: Homebrew Projects
Topic: Need input for view logic for Dodgeball
Replies: 13
Views: 6587

Need input for view logic for Dodgeball

I took a moment to think out a version of Dodgeball for the NES/FC. And while I would be very excited for being able to actually do a game where you have 6 characters on either side of a playfield, with the playfield working in the fashion of Ice Hockey, I am actually a bit confused on one very impo...
by tschak909
Tue Jul 18, 2017 4:08 pm
Forum: Homebrew Projects
Topic: WIP: Wizard of Wor
Replies: 165
Views: 78917

Re: WIP: Wizard of Wor

Doors and teleports working, next, scores... but I need to make a little queuing mechanism and make the functions use it... still thinking... in the mean time, a bit of silliness:

Image
by tschak909
Mon Jul 17, 2017 10:18 pm
Forum: Homebrew Projects
Topic: WIP: Wizard of Wor
Replies: 165
Views: 78917

Re: WIP: Wizard of Wor

Code that currently opens/closes the worrior doors /** * set_door(player, openclose) * player = Player 0 (blue) or Player 1 (yellow) door. * openclose = 0 for open, 1 for close. */ void set_door(unsigned char player, unsigned char openclose) { // Clear the update buffer clear_update_buffer(); // Set...
by tschak909
Mon Jul 17, 2017 1:00 pm
Forum: Newbie Help Center
Topic: How does SMB level compression work?
Replies: 9
Views: 3713

Re: How does SMB level compression work?

meh, SMB's level format looks like a typical "figure out exactly what you need, and how often you need it, and design exactly that" solution. :)

-Thom
by tschak909
Mon Jul 17, 2017 10:15 am
Forum: Homebrew Projects
Topic: WIP: Wizard of Wor
Replies: 165
Views: 78917

Re: WIP: Wizard of Wor

oh I know the joke, all too well. :) It's especially poignant on the VCS, because you're literally generating half of the video signal yourself! :) (I have literally made black and white pixels artifact into color on the VCS on accident.) ;) I just wanted to see how tight my tolerances are, since I ...
by tschak909
Mon Jul 17, 2017 7:43 am
Forum: Homebrew Projects
Topic: WIP: Wizard of Wor
Replies: 165
Views: 78917

Re: WIP: Wizard of Wor

Ok. I'm already basically doing this, I'll just not try to do it in one big buffer. (I was doing 256 bytes in BSS and just creating update records for every single thing to update, and simply just changing the data...) :)

-Thom