6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Apr 28, 2024 1:41 pm

All times are UTC




Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: W65C816SXB-Game-Of-life
PostPosted: Sun Nov 08, 2015 11:49 pm 
Offline
User avatar

Joined: Fri Oct 30, 2015 9:49 pm
Posts: 54
Location: San Antonio, TX
Howdy...

Spend some time converting an old project to the W65C816SXB board.
I managed to get it to play Game of life on my old 24x24 LED display... :D
The LED display is controlled by 9 MAX7219 LED controllers that is interfaced using the VIA.
The shift register in the VIA is used rather than bit banging the data with IO ports, this allows for a better shift out rate.
This one was used in another 6502 project so it wasn't to hard to convert, just had to make sure the code compiled on the WDC compiler.

High Res Picture of the setup,
https://raw.githubusercontent.com/alamorobotics/W65C816SXB-Game-Of-life/master/Game_Of_Life_01.jpg

Youtube: https://www.youtube.com/watch?v=wg5X4eiIO24

The code is on Github if you want to have a look at it...
https://github.com/alamorobotics/W65C81 ... me-Of-life


Attachments:
File comment: Game of Life pic
Game_Of_Life_01.jpg
Game_Of_Life_01.jpg [ 403.77 KiB | Viewed 3576 times ]


Last edited by Alamorobotics on Tue Nov 24, 2015 3:17 am, edited 1 time in total.
Top
 Profile  
Reply with quote  
PostPosted: Mon Nov 09, 2015 12:16 am 
Offline

Joined: Wed Jan 08, 2014 3:31 pm
Posts: 565
Neat looking LED board. I have a fondness for LED arrays having built several of them.


Top
 Profile  
Reply with quote  
PostPosted: Mon Nov 09, 2015 6:50 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10793
Location: England
Nice!


Top
 Profile  
Reply with quote  
PostPosted: Mon Nov 09, 2015 6:33 pm 
Offline
User avatar

Joined: Fri Oct 30, 2015 9:49 pm
Posts: 54
Location: San Antonio, TX
Thanks guys...

Got a video uploaded to YouTube...
https://www.youtube.com/watch?v=wg5X4eiIO24


Top
 Profile  
Reply with quote  
PostPosted: Fri Nov 20, 2015 6:18 pm 
Offline

Joined: Sun Feb 23, 2014 2:43 am
Posts: 78
This is awesome.


Top
 Profile  
Reply with quote  
PostPosted: Sat Nov 21, 2015 2:42 pm 
Offline
User avatar

Joined: Thu Nov 27, 2014 7:07 pm
Posts: 47
Location: Ocala, Fl, USA
That is very interesting, great really. Are you absolutely required to use the WDC compiler? I mean, if you can handle a plain binary file, then FASM might be the way to go. It has a fantastic macro engine, and there is even a special version (fasm g) designed specifically for creating new instruction sets. I'm using it right now to write test/OS code for a fantasy 32-bit 65c02 processor I came up with for an x86 assembly retro console project. All that aside, it was actually very easy to design the macro instructions so that you are able to write source code like ordinary 6502/816 assembly (actually you can make it any way you want). After that you have the full power of FASM, an awesome assembler which is itself written in pure assembler. There are several super IDEs out there that work just fine with FASM.

Just an idea, I guess. It's like all I hear from everyone is how bad the WDC IDE is -- and I, too, gave up on it in about 15 of the longest minutes ever -- yuck. Why not roll your own? If it's an idea you might have an interest in, PM me and I'll help get you started, maybe even work on the macro engine with/for you. I know of one turnkey 6502 engine already, and it was very easy for me to take that and expand on it. BTW, the only reason I didn't run with a 32-bit '816 in my project was because of the cumbersome SR mode selection mechanism.

It just seems like it should be easier to create the software so that you can focus on what you're obviously very good at -- exploiting '816 hardware.

Edit:
After a PM with Garth, I think it's a good idea to explain my use of the word "cumbersome" above. I love the 65816 and wish there was a 32-bit version out there, but after 20 years of programming the SuperCPU in hardware and emulation I do have a negative opinion about certain aspects. From our conversation:
Quote:
My "cumbersome" comment was directed at how messy it is to read '816 binary disassemblies, and I was looking for something (in my project) where intent is obvious just by looking at the instruction. Even my version of IDA gets '816 wrong sometimes. I'm like you in that I stay in native mode, although I tend to set register size as needed or applicable (and definitely always use macros --> Go8axy, Go16xy, etc.), and even though it may be faster or more functional even, my style is just very "messy" to read at the binary level. I go with 16-bit A // 8-bit XY as a general rule here, too, but 16-bit index registers are really the cat's meow, and I will use it (16-bit index registers) a lot.


Attachments:
File comment: One file is a 6502 macro engine found on the FASM forum, the other is one I adapted for testing the cpu in my own project. Probably not at all useful, just to show it can be done.
cpu.zip [12.21 KiB]
Downloaded 117 times
Top
 Profile  
Reply with quote  
PostPosted: Sun Nov 22, 2015 12:54 am 
Offline
User avatar

Joined: Fri Oct 30, 2015 9:49 pm
Posts: 54
Location: San Antonio, TX
Howdy...

I'm not sure you need the WDC compiler, it recently drove me nuts for two days so I think it's time to look into something else...
I had a piece of code like this,
Code:
SID_BASE      EQU $7F20      ; base address of SID port on SXB
SID_FR1LO     EQU SID_BASE
SID_FR1HI     EQU SID_BASE + $01
SID_PW1LO     EQU SID_BASE + $02
SID_PW1HI     EQU SID_BASE + $03
SID_CR1       EQU SID_BASE + $04
SID_AD1       EQU SID_BASE + $05
SID_SR1       EQU SID_BASE + $06
.
Do some stuff with an emulated SID @ $7F20...

Which didn't work and I could not figure it out until I started to look into what address is actually used.
Turns out that the offset is not added since I put a space in between SID_BASE and the offset.
So I changed the code to,
Code:
SID_BASE      EQU $7F20      ; base address of SID port on SXB
SID_FR1LO     EQU SID_BASE
SID_FR1HI     EQU SID_BASE+$01
SID_PW1LO     EQU SID_BASE+$02
SID_PW1HI     EQU SID_BASE+$03
SID_CR1       EQU SID_BASE+$04
SID_AD1       EQU SID_BASE+$05
SID_SR1       EQU SID_BASE+$06
.
Do some stuff with an emulated SID @ $7F20...

This piece of code works fine and the offset is added as expected...

Right now I'm trying to get used to the WDC compiler and the Atom editor...
The recommended editor is Ultra Edit which is only free for 30 days and then cost $80.
However switching out the editor in the IDE means that the editor does not launch properly, the editor launches but it does not open the file...

I don't think the problem would be to switch out the compiler, it's probably more of a question on how to get the debugger working in your own IDE by launching your code and allowing debugging...

Maybe ditch the WDC IDE and call their compiler and debugger separate works better, I think that is what BitWise is doing...

Let me read up on Fasm and see if it can be used...


Top
 Profile  
Reply with quote  
PostPosted: Sun Nov 22, 2015 1:19 am 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1927
Location: Sacramento, CA, USA
satpro wrote:
... After a PM with Garth, I think it's a good idea to explain my use of the word "cumbersome" above. I love the 65816 and wish there was a 32-bit version out there, but after 20 years of programming the SuperCPU in hardware and emulation I do have a negative opinion about certain aspects ...


I didn't need any explanation ... I was over here nodding my head in agreement as I was reading that sentence. :) It's not a feeling I can easily justify to others, but it's my feeling nonetheless.

Mike B.


Top
 Profile  
Reply with quote  
PostPosted: Sun Nov 22, 2015 2:50 am 
Offline
User avatar

Joined: Thu Nov 27, 2014 7:07 pm
Posts: 47
Location: Ocala, Fl, USA
Thanks Barry... it is hard to explain to people sometimes, isn't it? For example, the VICE emulator handles the 65816 SuperCPU very well, but they have not yet figured out a solution to '816 disassembly and it's no priority for them at all to fix; it's just a clusterflog all around. You just don't know exactly what mode a subroutine is in until you're into it -- sometimes too far. Then it's disassembly by hand and that's always a real drag. I had to do that to RE the hidden SuperCPU boot code before I got my hands on the IDA 65816 plugin. I made so many mistakes doing it by hand..... Glad (relatively speaking :D ) I'm not alone.

Alamorobotics:
Quote:
The recommended editor is Ultra Edit which is only free for 30 days and then cost $80.

I'll definitely agree that UltraEdit is really something, but for free IMO the way to go is Notepad++ (NPP). It has the Scintilla editor, runs a cli from the toolbar (for your batch file, etc), has a host of very cool plugins, and through the years I have customized it so that I can work in 65x and x86 simultaneously (GoAsm, FASM, 64tass) in side by side windows AND built-in console, complete with the highlighted syntax and all. I am happy to share the syntax files and how to get it just right for assembly. There is even a portable version. I don't know what I would do without it. Well... yes I do -- become a real crabass. :)

It's an ideal working environment (for me at least).


Top
 Profile  
Reply with quote  
PostPosted: Sun Nov 22, 2015 3:07 am 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1927
Location: Sacramento, CA, USA
satpro wrote:
... but for free IMO the way to go is Notepad++ (NPP). It has the Scintilla editor, runs a cli from the toolbar (for your batch file, etc), has a host of very cool plugins, and through the years I have customized it so that I can work in 65x and x86 simultaneously (GoAsm, FASM, 64tass) in side by side windows AND built-in console, complete with the highlighted syntax and all. I am happy to share the syntax files and how to get it just right for assembly. There is even a portable version. I don't know what I would do without it. Well... yes I do -- become a real crabass. :)

It's an ideal working environment (for me at least).

Please start a new thread and share with us! I'm still stumbling around in the dark-ages over here. Oh, and I love free!

Mike B.


Top
 Profile  
Reply with quote  
PostPosted: Sun Nov 22, 2015 4:33 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8147
Location: Midwestern USA
Alamorobotics wrote:
Howdy...

Spend some time converting an old project to the W65C816SXB board.
I managed to get it to play Game of life on my old 24x24 LED display... :D
This one was used in another 6502 project so it wasn't to hard to convert, just had to make sure the code compiled on the WDC compiler.

Picture of the setup,
https://raw.githubusercontent.com/alamorobotics/W65C816SXB-Game-Of-life/master/Game_Of_Life_01.jpg

The code is on Github if you want to have a look at it...
https://github.com/alamorobotics/W65C81 ... me-Of-life

Cool! Good job.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Sun Nov 22, 2015 4:51 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8147
Location: Midwestern USA
satpro wrote:
After a PM with Garth, I think it's a good idea to explain my use of the word "cumbersome" above. I love the 65816 and wish there was a 32-bit version out there, but after 20 years of programming the SuperCPU in hardware and emulation I do have a negative opinion about certain aspects. From our conversation:
Quote:
My "cumbersome" comment was directed at how messy it is to read '816 binary disassemblies...

I mostly resolved that issue in Supermon 816 by maintaining state information on any REP and SEP instructions that are encountered during disassembly. It's not perfect, but as long as some basic procedure is followed, immediate mode instructions will correctly disassemble.

Quote:
I'll definitely agree that UltraEdit is really something, but for free IMO the way to go is Notepad++ (NPP).

I tried out NPP, but ended up purchasing UltraEdit—and did not regret doing so. As is not totally untypical of free software, idiosyncrasies can (do, in the case of NPP) get in the way of productivity and the zero price turns out to not be such a great deal. UE has a very logical user environment and reflects the thinking of a professional software developer. I can't say the same thing about NPP.

As for the WDC IDE, I purchased it as well and after several hours of fighting with it, concluded that it was a time-waster and removed it from the system.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Sun Nov 22, 2015 7:05 pm 
Offline
User avatar

Joined: Thu Nov 27, 2014 7:07 pm
Posts: 47
Location: Ocala, Fl, USA
Quote:
As is not totally untypical of free software, idiosyncrasies can (do, in the case of NPP) get in the way of productivity and the zero price turns out to not be such a great deal. UE has a very logical user environment and reflects the thinking of a professional software developer. I can't say the same thing about NPP.

I am curious to know in more detail what is meant by the statement. For example, what sort of idiosyncrasies get in the way of productivity?


Top
 Profile  
Reply with quote  
PostPosted: Sun Nov 22, 2015 8:46 pm 
Offline
User avatar

Joined: Fri Oct 30, 2015 9:49 pm
Posts: 54
Location: San Antonio, TX
Howdy...

I saw that the Atom editor had some specific plug ins for 6502 editing and gave it a try.
It seem to me that you need to read the whole manual to customize it and I'm not prepared to do that... :D
I'm about to give up on Atom, there does not seem to be a fix for the "copy/paste" feature.
The feature is that you loose all your tabs unless you specifically paste in a special way...

I've been using Notepad++ for about three years but never customize it.
I like it and I think it's about time I make some effort to learn how to customize it.

Anyhow, this original thread was about the 24x24 LED display and an old project I converted to the W65C816SXB board.
I would like to continue discuss editors but I think we need a new thread for that...


Top
 Profile  
Reply with quote  
PostPosted: Sun Nov 22, 2015 9:14 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8147
Location: Midwestern USA
satpro wrote:
Quote:
As is not totally untypical of free software, idiosyncrasies can (do, in the case of NPP) get in the way of productivity and the zero price turns out to not be such a great deal. UE has a very logical user environment and reflects the thinking of a professional software developer. I can't say the same thing about NPP.

I am curious to know in more detail what is meant by the statement. For example, what sort of idiosyncrasies get in the way of productivity?

Perhaps a new topic on editors should be started instead of hijacking this one. :)

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 16 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: