6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Nov 21, 2024 11:02 pm

All times are UTC




Post new topic Reply to topic  [ 23 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Sun May 23, 2021 7:00 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
I'm sure you mean ms, not ns. (1ms is 1,000,000ns.) If you have an odd clock frequency, what you can do is have the ISR add or subtract a tick every so many, in the RAM variables. This also works for correcting for an oscillator that's a little off, like if you were able to compute the perfect number but you find the clock gets ahead or behind by a few seconds a month.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Mon May 24, 2021 6:11 am 
Offline

Joined: Tue Jan 22, 2019 4:47 am
Posts: 18
Location: Louisiana
GARTHWILSON wrote:
I'm sure you mean ms, not ns. (1ms is 1,000,000ns.) If you have an odd clock frequency, what you can do is have the ISR add or subtract a tick every so many, in the RAM variables. This also works for correcting for an oscillator that's a little off, like if you were able to compute the perfect number but you find the clock gets ahead or behind by a few seconds a month.


Didn't even notice the ns typo until you pointed it out. Whoops!

Still cracking away at figuring out what the value should be. I'm still not entirely sure if I should be getting a value of hex 44 or hex 47, since you did state that it's meant to be a 16 bit value.

To throw my two cents in, shouldn't the value go up with faster clock speeds since there are more cycles in a second, and therefore more cycles in a millisecond? So why am I getting a waaay lower value? Am I doing the equation wrong? (which, since I suck at math, would make sense)

_________________
-------------------------------
Have an awesome day!


Top
 Profile  
Reply with quote  
PostPosted: Mon May 24, 2021 8:18 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
I put that T1 period = n+2 / φ2 freq, depending on the space to group things appropriately, instead of using parentheses. I guess I should put the parentheses in. If the desired T1 period is 10ms and your φ2 freq is 7.3728 MHz, you'd have:
10ms = (n+2) / φ2_freq
10ms x φ2_freq = n+2 = .01 x 7.3728M = .01 x 7,372,800 = 73,728.
Subtracting 2 to get n, you get 73,726, which is $11FFE. Oops. Too big to fit in a 16-bit number. You'll have to down to 8.8889ms or less. 8.8889 is not a nice, round number though. You'll probably want to go down to 5ms, and if you still have a 10ms resolution in your variables, increment every second interrupt, keeping a flag byte and toggling it at each interrupt and examining it to see if it's time to do the other stuff. You could clear the byte with STZ, and set it with DEC (since 00 turns to $FF with a decrement), then test it with BIT (remember it transfers bit 7 to the N flag regardless of what's in A, then you can do a BPL or BMI), or with LDA (or LDX or LDY) and then test it with BEQ or BNE. Anyway, the number would be:
5ms = (n+2) / φ2_freq
5ms x φ2_freq = n+2 = .005 x 7.3728M = .005 x 7,372,800 = 36,864
Subtracting 2 to get n, you get 36,862, which is $8FFE.

In both cases, the results are integers, with no fractional part; so if your crystal frequency has no error, you should have perfect timing.

Hopefully I did all that correctly. It does sound about right though.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 11, 2021 5:56 pm 
Offline
User avatar

Joined: Tue Aug 11, 2020 3:45 am
Posts: 311
Location: A magnetic field
I highly recommend the documentary Tetris: From Russia with Love. Even if you're not into gaming, it is a wonderful slice of 1980s technology with period footage and interviews with pivotal characters. I believe that cbmeeks, in particular, will appreciate it. If you're in a similar mood, you may also appreciate Moleman's demoscene documentary. This may also provide inspiration for a rolling demo.

Despite that, I strongly recommend against implementing Tetris because it is highly addictive and productivity will drop to zero. I mentioned Tetris to Sheep20. After "What's Tetris" and watching the documentary, productivity returned approximately two months later. At one point, Sheep20 was playing a JavaScript version of Tetris over Citrix. That's hugely addicted.

Given the overlap of functionality, it should be possible to fit a Tetris clone and maze game into 8KB. Or perhaps a maze game and a Boulderdash clone. Or perhaps Boulderdash and a Candy Crush clone. It is also possible to fit Eliza into 8KB. Some people find Eliza to be an amusingly poor attempt at Artificial Intelligence. Others find it more helpful than Cognitive Behavioral Therapy.

An ex-classmate's cousin wrote a VIC20 lake fishing simulator. When I first saw it, I thought that it was the most dull, inane game that I'd ever seen. However, I'm now beginning to appreciate the idea. Starting with $100, choose your rod, reel, tackle and bait. Then choose one of the 10 lakes which were all terrible puns. (There's further scope for puns with RAM-bow trout, carptridge and I'll skip the obvious joke but it was written in BASIC.) Choose competitive fishing or quiet contemplation. There was a particular technique to cast a reel using keyboard or joystick and the display had an underwater camera view of the nearby fish. Each lake has a different variety of fish with different temperament and different attraction to bait. After selling your catches - and possibly collecting prize money - you can buy a better rod, reel and bait before trying another lake.

If you want something more nurturing, you could write an aquarium simulator or other virtual pet system.

The best suggestion for a game is inspired by the Crazy Ideas section of Reddit. Clippy Land is like Mario Bros. which was originally 6502 only. Mario the Plumber and friends are replaced with Clippy the Paper Clip and the lesser known Microsoft Office Assistants. (Can you believe there were 11 of them?) Unlike Paper Mario, Clippy gets bonus items from origami cube loot boxes and dodges origami monsters before rescuing Power Pup. Or Microsoft Bob or something. The sequel, Super Clippy Land, only runs on 65816. Also look out for Klippy Kart, Clippy World and the film featuring the resurrected voice of Bob Hoskins.

Nintendo has Mario. Sega has Sonic. Amiga has Zool. Even the Sinclair Spectrum has Horace. We have the abandonware which Microsoft would rather forget.

_________________
Modules | Processors | Boards | Boxes | Beep, Beep! I'm a sheep!


Top
 Profile  
Reply with quote  
PostPosted: Mon Nov 15, 2021 4:11 pm 
Offline
User avatar

Joined: Fri Dec 12, 2008 10:40 pm
Posts: 1007
Location: Canada
ashtons wrote:
- BASIC (might be tinybasic, might be EhBASIC, might be custom, who knows!)


EhBASIC won't fit into 8K but there are versions of MS BASIC that will.

_________________
Bill


Top
 Profile  
Reply with quote  
PostPosted: Fri Nov 19, 2021 3:42 am 
Offline

Joined: Tue Jan 22, 2019 4:47 am
Posts: 18
Location: Louisiana
BillO wrote:
ashtons wrote:
- BASIC (might be tinybasic, might be EhBASIC, might be custom, who knows!)


EhBASIC won't fit into 8K but there are versions of MS BASIC that will.

I figured that out pretty quickly after looking up EhBASIC. It needs 10K of memory to hold the interpreter. While that means it could potentially be loaded into the system's 32K of RAM (leaving around 22K for user code and data, a little less if you don't include the 64 bytes of system defined variables in the zero page and the 256 byte stack), there wouldn't be much point in doing that since there would be a BASIC implementation on ROM. I figured that it should be possible to fit BASIC into 8K though, since TinyBASIC fits into 4K or fewer.

Sheep64 wrote:
I highly recommend the documentary Tetris: From Russia with Love. Even if you're not into gaming, it is a wonderful slice of 1980s technology with period footage and interviews with pivotal characters. I believe that cbmeeks, in particular, will appreciate it. If you're in a similar mood, you may also appreciate Moleman's demoscene documentary. This may also provide inspiration for a rolling demo.

Despite that, I strongly recommend against implementing Tetris because it is highly addictive and productivity will drop to zero. I mentioned Tetris to Sheep20. After "What's Tetris" and watching the documentary, productivity returned approximately two months later. At one point, Sheep20 was playing a JavaScript version of Tetris over Citrix. That's hugely addicted.

Given the overlap of functionality, it should be possible to fit a Tetris clone and maze game into 8KB. Or perhaps a maze game and a Boulderdash clone. Or perhaps Boulderdash and a Candy Crush clone. It is also possible to fit Eliza into 8KB. Some people find Eliza to be an amusingly poor attempt at Artificial Intelligence. Others find it more helpful than Cognitive Behavioral Therapy.

An ex-classmate's cousin wrote a VIC20 lake fishing simulator. When I first saw it, I thought that it was the most dull, inane game that I'd ever seen. However, I'm now beginning to appreciate the idea. Starting with $100, choose your rod, reel, tackle and bait. Then choose one of the 10 lakes which were all terrible puns. (There's further scope for puns with RAM-bow trout, carptridge and I'll skip the obvious joke but it was written in BASIC.) Choose competitive fishing or quiet contemplation. There was a particular technique to cast a reel using keyboard or joystick and the display had an underwater camera view of the nearby fish. Each lake has a different variety of fish with different temperament and different attraction to bait. After selling your catches - and possibly collecting prize money - you can buy a better rod, reel and bait before trying another lake.

If you want something more nurturing, you could write an aquarium simulator or other virtual pet system.

The best suggestion for a game is inspired by the Crazy Ideas section of Reddit. Clippy Land is like Mario Bros. which was originally 6502 only. Mario the Plumber and friends are replaced with Clippy the Paper Clip and the lesser known Microsoft Office Assistants. (Can you believe there were 11 of them?) Unlike Paper Mario, Clippy gets bonus items from origami cube loot boxes and dodges origami monsters before rescuing Power Pup. Or Microsoft Bob or something. The sequel, Super Clippy Land, only runs on 65816. Also look out for Klippy Kart, Clippy World and the film featuring the resurrected voice of Bob Hoskins.

Nintendo has Mario. Sega has Sonic. Amiga has Zool. Even the Sinclair Spectrum has Horace. We have the abandonware which Microsoft would rather forget.

Okay, so: don't do Tetris because it's addictive. Can fit Eliza into 8K (possibly make Eliza drunk?). Can also potentially fit two games into 8K, especially if code can be reused for both. Someone made a punderful fishing game for the VIC 20. An aquarium simulator or other virtual pet game could work. Some people made a freaking Clippy platformer? And there was a sequel? What? Also, documentaries about gaming and the demo scene.

Hopefully I got everything from that. This is all giving me a lot to think about in terms of what the game could be, and also how to do a rolling demo.

_________________
-------------------------------
Have an awesome day!


Top
 Profile  
Reply with quote  
PostPosted: Sun Feb 27, 2022 2:08 pm 
Offline
User avatar

Joined: Tue Aug 11, 2020 3:45 am
Posts: 311
Location: A magnetic field
ClippyLand is only an idea. However, much like Snow White and the Seven Samuri, it is one of those ideas which may yet become reality.

Anyhow, I have an absolute winner of an idea for a 6502 game, although it might not fit into 8KB: Dance Dance Revolution: PETSCII Chip Tune Edition. For those unfamiliar with dance and guitar games, a special peripheral is required such as a floor mat with switch matrix. The player then has to follow actions on screen while being distracted with unrelated visuals. Long sequences of acurate inputs obtain bonus points. Like bowling, long sequences of proficient action obtain a very outsized score.

These musical games usually have a large selection of tunes. The music (with album covers) can be previewed from joystick type menu system. This part alone works like a very capable jukebox system. However, some systems may only allow advanced tunes to be attempted after easier tunes have been completed to a minimum standard.

Typically, these games use 3D vector graphics and 16 bit PCM sound. However, there is no reason why such games could not have existed in the 1990s, using lesser graphics and sequenced music. Indeed, given the popularity of MIDI ring tones for phones, a selection of music would have been quite feasible and popular. As a further example, note the similarity and difference between F-Zero for the 65816 SNES and Sony's Wipeout. Both were launch titles for game consoles. However, Wipeout only featured Sony musicians, well, on the occasions that it didn't freeze. There is definitely scope for "back-porting" a dance game to 8 bit. Indeed, the simplified graphics and sound may be preferable.

To get you started with PETSCII dance games, I have taken the listing from page 99 of the VIC20 User Manual for the "VIC person" who does jumping jacks and drawn it as a GIF animation. I believe that the legs are wonky because symmetrical legs would require use of inverse video attributes and this would complicate the listing. It can be easily corrected after the given listing has been entered correctly. A disproportionate remainder of the manual covers sound generation - despite having no sound commands. There is also a brief listing for a bouncing ball which can be expanded into a decent version of Pong. It can also be used to make the type of distracting visuals typically found in dance games.

The $0x and $Fx ranges of the SNES peripheral extension allow 30 distinct types of peripheral to be used in place of a standard SNES joypad. One of these is intended to be a dance mat. Another could be assigned to a guitar. Indeed, it would be possible make a dance/guitar game which adjusts itself according to available peripherals. Actually, I don't think that anyone has made a game which allows two or more guitarists and two or more dancers.


Attachments:
vic-person.gif
vic-person.gif [ 235 Bytes | Viewed 760 times ]

_________________
Modules | Processors | Boards | Boxes | Beep, Beep! I'm a sheep!
Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 29, 2022 3:02 pm 
Offline
User avatar

Joined: Tue Aug 11, 2020 3:45 am
Posts: 311
Location: A magnetic field
ashtons on Fri 19 Nov 2021 wrote:
possibly make Eliza drunk?


A program is more likely to pass a Turing test when it works in a restricted domain, such as imitating drunkeness. However, Eliza mostly has to match strings and provide a few generic responses if nothing matches. A small decompressor may greatly increase the scope of Eliza's responses.

ashtons on Fri 19 Nov 2021 wrote:
punderful


I have a punderful idea for a game which definitely fits into 8KB. Make a game which is similar to Frogger but has an exercise theme or works with a dance mat. Call it Jogger.

_________________
Modules | Processors | Boards | Boxes | Beep, Beep! I'm a sheep!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: