Jump to content
Andrew Davie

Chess

Recommended Posts

7 hours ago, Mr SQL said:

 

X3 and I think an important part of the philosophy is that coding to the old hardware is a big part of the nostalgia and hence the fun, particularly for programmers who were part of the scene writing cool 8-bit video games in the 80's.

 

Gameloop internals coded to a 32-bit chip can be a less interesting option for old school programmers for this reason.

 

You created Batari BASIC for classic hardware, would you find it comparitively interesting to create a full featured 32-bit ARM BASIC with an interactive debugger for the Atari like shown for the Vectrex here than your classic hardware implementation?    

 

Close to 10 years ago I was going to set up a C build environment in conjunction with bB, where you could create games in either language, or both. I never quite got around to it though. It actually wouldn't be terribly hard to do, as bB already has C routines with DPC+ and likely all I would have to do is post up the source code for it all, work out some details with memory usage and write some documentation on how to use it.

 

An interpreted ARM BASIC would be possible too, but would be quite a bit of work to get it set up. I suppose you'd need to adapt a keyboard to the 2600 and create some means to save your programs. Maybe a better way is if there happens to be an open-source compiled BASIC out there that could be adapted.

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, batari said:

Close to 10 years ago I was going to set up a C build environment in conjunction with bB, where you could create games in either language, or both. I never quite got around to it though. It actually wouldn't be terribly hard to do, as bB already has C routines with DPC+ and likely all I would have to do is post up the source code for it all, work out some details with memory usage and write some documentation on how to use it.

 

An interpreted ARM BASIC would be possible too, but would be quite a bit of work to get it set up. I suppose you'd need to adapt a keyboard to the 2600 and create some means to save your programs. Maybe a better way is if there happens to be an open-source compiled BASIC out there that could be adapted.

Very cool! :) there is one project underway to create a Tiny C and a similarly inclined Java demo for the C64 with balloon classes that is pretty interesting. I think the BASIC to c Translator the Jag developers are using might be applicable for adaptation to an ARM framework from one of the new c games.

 

32-bit technology like the ARM bring modern choices like the interpreted BASIC or a translated and compiled BASIC or a c variant, but the new Chess as well as Sokoban and BD all have RUNTIME frameworks for tilemapped games that a vanilla 6502 based compiled BASIC such as bB or even a custom 6502 tiny C could leverage.

 

I find both sets of technologies interesting, but the classic development more. 

Share this post


Link to post
Share on other sites
Posted (edited)

Still not sure why the computer is reluctant to castle, but I did find one issue -- I had left the evaluation table for "endgame" in, and that prefers to move the king towards the center. Whoops.  The correct table is now installed, and there have been a few changes here and there. One of those is me playing (yet again) with the palettes. I've worked a bit on getting the three colours to be complementary (and rich) red/green/blue so that their combination is a reasonable white, yet still distinct when mixed as "yellow".  Anyway, these are the colour values...

COLOUR_LINE_1 = $86
COLOUR_LINE_2 = $48
COLOUR_LINE_3 = $DA

and here's the visuals...

 

 

and of course a test binary...
 

chess20200614_3PQ6.bin

Edited by Andrew Davie
  • Like 5

Share this post


Link to post
Share on other sites
On 6/11/2020 at 11:11 AM, Andrew Davie said:

ARM gives you like a gazillion bytes of RAM as well. I bet the RAM usage of some of the ARM games is quite significant.

 

There's 32K of ROM and 8K of RAM in the Harmony/Melody. First chunk of the ROM is dedicated to the driver, and must be copied into RAM during the startup sequence due to performance reasons - RAM access is 4x faster than ROM access, as covered by @cd-w in this blog post.

 

The newer CDFJ driver is 2K, so your program gets 30K of ROM and 6K of RAM.  

 

I go over the layout of the CDFJ memory in the CDFJ tutorial. Here's a high level overview, check part one of the tutorial for specifics:

 

Screen Shot 2019-10-31 at 3.27.52 PM.png

 

The older DPC+ driver is 3K, so 29K of ROM and 5K of RAM is left for your program.  It's layout is:

 

Cart Layout.png

 

Quote

It's a real shame we don't get to see the internals of those games.

 

Here's the source for Draconian (uses CDF, early version of CDFJ) as well as for Space Rocks (uses DPC+). Was easier to find those when the blogs still had categories.

 

Likewise the old DPC+ tutorial is hard to find, but @Dionoid posted an index in the comments to the DPC+ tutorial announcement.

  • Like 3
  • Thanks 3

Share this post


Link to post
Share on other sites

I guess we'll call this one a failed experiment on the path to perfection.

 

The idea was to OR-in text over the top of the board. Since I'm just experimenting, I typed in the text as a patterns of 0 and 1s, and the bitmap format/layout is so bizarre it did my head in and I gave up after writing CHEC.... but in any case it give the idea how it would look.  Although the text in the video is a single row, the idea is that it would be taller and overlap several rows.  In any case, this experiment shows me that just ORing-in the text just isn't going to work very well. I have to come up with another way to do this.  Perhaps just have the text in a box, and draw the entire box.

At least the systems to restore the screen are working OK.  I just need to figure another way to draw the text.  Perhaps just white text on a black box with a bit of a border...

 

 

/END_EXPERIMENT_#892312

Share this post


Link to post
Share on other sites

I'm not sure how text could be done in a way that's not annoying. Your first attempt blends in with the pieces too much as you saw. The black box background would make the text look good, but it would obscure the board, which I think would throw off the flow of a game. Maybe just having a symbol appear for events like that, such as a checkmark, to be drawn with a player object on an empty square? Just an idea.

Share this post


Link to post
Share on other sites

This is more promising...  here I first OR-in a white background, and then i EOR-out the text. So it's 2 frames per row to draw. And then I blink it.

So for a 2-row text, it will take 2 frames to draw the white BG, another.2 to draw the text. I'll get something going to see if that's workable...

Using this method, I can't change the white background, but the text (or image, as it's just a bitmap) over the top of that can be any of the 7 avaialable colours - each pixel independently coloured.

 

  • Like 1

Share this post


Link to post
Share on other sites

I think it looks fine. You might also have an alternate kernel, where the board display is interrupted mid-screen, to do six-digit score. Just throw in some blank lines for setup and cleanup.

Share this post


Link to post
Share on other sites

I guess with the flashing of text, it doesn't really interfere with viewing the board.  I'm looking forward to seeing how I like it in practice on my Uno when you upload a new build.

Share this post


Link to post
Share on other sites

First thing to check was that I could draw a full-screen and not run out of processing time.  This entails, first saving the bitmap data for each row, and then for 8 rows, first drawing the white background, and then for 8 rows drawing the text, and then for 8 rows restoring the original bitmap. Repeat.  Video shows this in action - it's effectively flashing on and off as fast as it possibly can. There's a LOT of data shifting around. It's acceptable. Although each row is showing the same data... it can show any data at all.  So, all good I think -- now off to write the tool to convert from a graphic image into the bitmap tiles. There will be "CHECK", "DRAW", "YOU WIN", "I WIN", "STALE MATE", "CHECK MATE" and "SWAP SIDE" and that's about it, I think. That will use a lot of ROM.

 

  • Like 1

Share this post


Link to post
Share on other sites

I've pretty much settled on the technicals now. There will be two "planes" for anything that's drawn as a bitmap overlay. Plane #1 is a mask, and its job is to remove pixels from the board.  So, it will be just 1-bits for pixels to keep on the board and 0-bits for pixels to remove. So the first part of the draw is to AND the mask with the board graphics; think of this as "carving out" a black area for the bitmap to be drawn into.  The second part is to OR the new bitmap onto the board.  This means that I can simply create two layers in an image - the bottom layer being the mask (pixels to remove) and the top layer being new pixels to place on.  I've already checked there's sufficient time to do this, so now to the tool.  I've discovered that GIMP - the image editor I use - outputs ".ora" files, which are zip files with each layer saved as a .png image.  This might be the easiest way to go, in terms of usage/modification/tool.

 

I expect this will take me a couple of days to get running - but the nice thing is that I won't ever have to worry about clashing with whatever is already on the screen - I can simply mask that out, irregular shapes and all - and I expect it will look nice enough.  

 

  • Like 4

Share this post


Link to post
Share on other sites
15 hours ago, Andrew Davie said:

Dump of the lastest source code for posterity/review.

Start with 'chess.asm' and follow the include files at the end.

 

chess3e+20200705.zip 2.72 MB · 10 downloads

 

Thanks for providing this!  I'm sure much of it will be over my head, but it's still interesting to see.  Are there any macro definitions needed that aren't in this archive? My attempt to assemble fails due to multiple references to "SETSTR".

Share this post


Link to post
Share on other sites
7 hours ago, Karl G said:

 

Thanks for providing this!  I'm sure much of it will be over my head, but it's still interesting to see.  Are there any macro definitions needed that aren't in this archive? My attempt to assemble fails due to multiple references to "SETSTR".

It's a new dasm pseudo-op, and not yet in the release packages. You can grab the latest binary from the dasm master from here, or otherwise wait for the next official release.

  • Thanks 1

Share this post


Link to post
Share on other sites

After getting the snapshot, I was able to build, but it crashes right away after drawing the board with Stella 6.2.1.

Share this post


Link to post
Share on other sites
Posted (edited)
17 hours ago, Andrew Davie said:

Dump of the lastest source code for posterity/review.

 

Andrew, I always look forward to your updates. Maybe I’m reading too much between the lines here, but I remember that you mentioned depression a few weeks ago, and I have noticed that your updates have slowed down. So I hope you continue to work on these games. More than that I hope you remain a part of this community. And more than that I hope you are doing well or at least okay in real life.

 

Feel free to reach out if you ever need to talk.

Edited by bizarrostormy
  • Like 1

Share this post


Link to post
Share on other sites
4 hours ago, Karl G said:

After getting the snapshot, I was able to build, but it crashes right away after drawing the board with Stella 6.2.1.

If there is a line "CALL Breaker" around #210 in file "@1 STATE MACHINE #2.asm" -- remove it.

It was debug/diagnostic code to help track a Stella bug, and designed to crash :)

Sorry about that - I didn't expect anyone to actually run it :)

Also there will be annoying flashing text after each move - joystick move then button held down gets rid of that.

 

  • Like 1

Share this post


Link to post
Share on other sites
4 hours ago, bizarrostormy said:

 

Andrew, I always look forward to your updates. Maybe I’m reading too much between the lines here, but I remember that you mentioned depression a few weeks ago, and I have noticed that your updates have slowed down. So I hope you continue to work on these games. More than that I hope you remain a part of this community. And more than that I hope you are doing well or at least okay in real life.

 

Feel free to reach out if you ever need to talk.

 

Thank you. I'm OK. I have practically zero motivation to do any programming at the moment, though - even though I desperately want to be productive it's just not happening.  I'd really like to be working, but haven't had a job for quite a while, and I'm sure that's a lot to do with it. I appreciate you reaching out, and everyone should follow that example :)

  • Like 6
  • Thanks 2

Share this post


Link to post
Share on other sites
4 hours ago, Andrew Davie said:

Here is an updated archive of the source, with the "crash" diagnostic removed, and also the text now only flashes briefly.

 

 

chess3E+20200706.zip 2.72 MB · 1 download

Thanks for the source Andrew - this will come in very useful if I can get the compile error process working in ADS (terminal windows are very basic unfortunately).

4 hours ago, Andrew Davie said:

 

Thank you. I'm OK. I have practically zero motivation to do any programming at the moment, though - even though I desperately want to be productive it's just not happening.  I'd really like to be working, but haven't had a job for quite a while, and I'm sure that's a lot to do with it. I appreciate you reaching out, and everyone should follow that example :)

Sorry to hear that mate - hang in the my friend hopefully some good news around the corner for you soon 👍

Share this post


Link to post
Share on other sites
15 hours ago, Andrew Davie said:

Thank you. I'm OK. I have practically zero motivation to do any programming at the moment, though - even though I desperately want to be productive it's just not happening.  I'd really like to be working, but haven't had a job for quite a while, and I'm sure that's a lot to do with it. I appreciate you reaching out, and everyone should follow that example

I think I mentioned that I am totally motivation-free at this time also.  I have a ton of work and school to do and just want to blob out.  I just can't even.

 

I did, however, manage to do laundry last night which was a major event!

 

gotta take solace in the small accomplishments...

 

the important thing is to realize that this is a crazy time for *everyone*.  Lots of people are having problems, they just express it differently.  some people are more productive, some people are less productive, some work in fits and starts, etc.

 

eventually we'll all get our mojos back.  it might just take a while.

 

if coding isn't that motivating right now, maybe just use the forums to hang out and talk to people.  sometimes contact is the best medicine.

 

it's hard when not working though.  I have gone through periods where I have not had work and it can get very weird, so I feel you.

  • Thanks 1

Share this post


Link to post
Share on other sites

I don't know why I didn't give this a go before!  This version is generating an interlaced TV frame. And it looks fabulous.

The single-line blue shading of the squares, for example, are now thicker. It's subtle, but now there's more colour on the screen. Lines are thicker.

I don't think the emulators show this properly - I have a vague memory that Stella dropped interlaced support - yet to be confirmed.

But tested out on my NTSC TV and it's not noticeably flickery, and definitely different compared to the non-interlaced version. I like it. I think interlacing the display definitely lends itself to the "chronocolour" type display.

So, give this a whizz (on real TVs, not emulators, please) and let me know your opinions. I'm waiting eagerly.

 

 

chess3E+20200706_INTERLACED.bin

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites
55 minutes ago, Andrew Davie said:

I don't know why I didn't give this a go before!  This version is generating an interlaced TV frame. And it looks fabulous.

The single-line blue shading of the squares, for example, are now thicker. It's subtle, but now there's more colour on the screen. Lines are thicker.

I don't think the emulators show this properly - I have a vague memory that Stella dropped interlaced support - yet to be confirmed.

But tested out on my NTSC TV and it's not noticeably flickery, and definitely different compared to the non-interlaced version. I like it. I think interlacing the display definitely lends itself to the "chronocolour" type display.

So, give this a whizz (on real TVs, not emulators, please) and let me know your opinions. I'm waiting eagerly.

chess3E+20200706_INTERLACED.bin 31 kB · 1 download

Tested on PAL 2600jr with PlusCart

 

IMG_20200707_144200.thumb.jpg.09a4e10a5a3fef28eeef7a79dce400f7.jpg

 

 

  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)
17 minutes ago, Al_Nafuur said:

Tested on PAL 2600jr with PlusCart

 

IMG_20200707_144200.thumb.jpg.09a4e10a5a3fef28eeef7a79dce400f7.jpg

 

 

Thanks - sorry, Chess is currently NTSC only - I should have reiterated this!

Edit: Having said that, only the colours should be screwed; the TV seems to be coping with the actual image. My perception, though it's hard to tell for sure from the picture - is that the lines for the squares seem to be slightly thicker - the gap between them is reduced compared to earlier versions.

 

Edit2: Despite being B&W - the contrast between the black and white pieces themselves is excellent. Very happy with that.

Edited by Andrew Davie
  • Like 3

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...