I finally managed to get a stable framework now (more or less), complete with interrupts. I did have to go looking for some answers though as I was getting nowhere fast! Turns out when the 65816 is in native (16bit) mode, its IRQ vectors move to $FFEE and $FFEA. Oh well, live and learn (again). When I did this on the SNES I would have done that the 1st couple of days then forgotten about it!
Anyway, now that its running the real problems with block transfer routines show themselves; you can't interrupt them! Yup, on most CPU's the next interrupt happens at the end of the last instruction - EVEN if that instruction takes seconds to complete! So, looks like I'd need a loop around a few of these, or not use it at all!
I guess for the final BLIT, as long as I knew it wasn't going to interfere I could use it, but it does look like the best/safest way is simply to use lda/sta instructions, Oh well.
Monday, December 03, 2007
Saturday, December 01, 2007
SuperCPU: Wowza!
You know the more I toy with this machine, the more I'm blown away by it. Now that I have a reasonably stable assembler I can see just what its capable of.
For example, a full BITMAP copy using the block transfer instruction runs in at around 56 scan lines (7 characters high), while a transfer to NON vic memory runs in at around 40 scan lines (5 chars high). Thats fast, really fast! Normally, this would take over a frame to do. It means that software sprites AND bitmap scrolling is easily possible, and it would be interesting to take over the XeO3 sprite routine and apply it to a bitmap screen.
I suspect you could do a parallax bitmap scroll in the same way I did a character one, but by using a bitmap screen you would get access to many more colours.
If you ran the game in 2 frames (same as XeO3), you would have a phenominal ammount of CPU time to burn, and could probably fill the screen with software sprites!
All that said, I am still having problems using the SuperCPU to its fullest as I can't seem to access the higher banks without it locking up (using the block transfer instruction).
For those interested, I've been using THIS PAGE as my 65816 refrence. Although I do have an old 65816 cycle sheet from my SNES days somewhere....
You know, the more I think about it, the more I think that 16Mb of RAM and sprite caches would be amazing! I need to do a new SuperCPU demo :)
For example, a full BITMAP copy using the block transfer instruction runs in at around 56 scan lines (7 characters high), while a transfer to NON vic memory runs in at around 40 scan lines (5 chars high). Thats fast, really fast! Normally, this would take over a frame to do. It means that software sprites AND bitmap scrolling is easily possible, and it would be interesting to take over the XeO3 sprite routine and apply it to a bitmap screen.
I suspect you could do a parallax bitmap scroll in the same way I did a character one, but by using a bitmap screen you would get access to many more colours.
If you ran the game in 2 frames (same as XeO3), you would have a phenominal ammount of CPU time to burn, and could probably fill the screen with software sprites!
All that said, I am still having problems using the SuperCPU to its fullest as I can't seem to access the higher banks without it locking up (using the block transfer instruction).
For those interested, I've been using THIS PAGE as my 65816 refrence. Although I do have an old 65816 cycle sheet from my SNES days somewhere....
You know, the more I think about it, the more I think that 16Mb of RAM and sprite caches would be amazing! I need to do a new SuperCPU demo :)
Friday, November 30, 2007
65816: Aaaaaaaannnnnnnddddd we're done..........
Well, I appear to have now finished 65816 support. I had some nasty little bugglets that were messing with my REP/SEP commands which is exactly the reason I couldn't swap in/out of it easily! Basically, even in 16bit mode, Rep/Sep are 8bit commands, but it was saving 16bit immediate values, which meant it would then hit a $00 (brk) as the next instuction.
So, this is pretty cool, as I'm now done with the core supprt for 65816 and 65c02. It still needs heavy testing, but looks like its mostly there.
While I was at it, I also fixed a couple of other instructions in normal 6502 mode that were broken ( jmp($1234), and lax $00,y). So that helps me anyway for XeO3.
So all I need to do now is release this version and then back onto paths for xeo3!
(have I mentioned just how much I HATE doing paths???)
So, this is pretty cool, as I'm now done with the core supprt for 65816 and 65c02. It still needs heavy testing, but looks like its mostly there.
While I was at it, I also fixed a couple of other instructions in normal 6502 mode that were broken ( jmp($1234), and lax $00,y). So that helps me anyway for XeO3.
So all I need to do now is release this version and then back onto paths for xeo3!
(have I mentioned just how much I HATE doing paths???)
Thursday, November 29, 2007
65816: Problems....
Okay....I was a bit peeved that I released the latest SNASM with only partial 65816 support, so I've decided to finish it off. While doing this, I've hooked up my SuperCPU again along with my fab new Heavy Duty PSU.
I'm pleased to say my MMC64 and Ethernet still work on the super CPU, so downloading is a doddle. You know...I was halfway through this post, moaning that nothing was working, and then I noticed a REALLY stupid mistake, and now all is well....
So now I have a full 65816 - 16bit program running!! COOOOOOL!
Slight problems still exist however....If I'm in 16bit mode, I cant go into 16bit mode. (yes you read that right). Its a bit strange. As its not that big, I've done a HEX dump on the code and it all lookgs fine!
*sigh*........What the hells wrong now.......
I'm pleased to say my MMC64 and Ethernet still work on the super CPU, so downloading is a doddle. You know...I was halfway through this post, moaning that nothing was working, and then I noticed a REALLY stupid mistake, and now all is well....
So now I have a full 65816 - 16bit program running!! COOOOOOL!
Slight problems still exist however....If I'm in 16bit mode, I cant go into 16bit mode. (yes you read that right). Its a bit strange. As its not that big, I've done a HEX dump on the code and it all lookgs fine!
*sigh*........What the hells wrong now.......
Wednesday, November 28, 2007
New Release!!!!
I have just done my first new release of Minus4 in about 2-3 years!! Yes all these new features I keep going on about are have now been released into the wild. So if you head on over to THE MINUS4 HOMEPAGE you'll be able to download new versions of Minus4w, Minus4wsrc and the new Snasm.
The new Snasm also has a lot of 65816 assmbler support in it, but mre importantly outputs symbols for Minus4's built in debugger.
If theres any cool features you can think of, let me know.... Minus4 has moved from being the best emulator (now easily beaten by YAPE) to being the best for development - by far!
XeO3 is being developed using SNASM as the assembler, and Minus4 as the debugger. Yape provides more realistic playback, and the uploader provides real hardware downloading! All I really need to do is finish the remote debugger and we'd have a full devkit!!
The new Snasm also has a lot of 65816 assmbler support in it, but mre importantly outputs symbols for Minus4's built in debugger.
If theres any cool features you can think of, let me know.... Minus4 has moved from being the best emulator (now easily beaten by YAPE) to being the best for development - by far!
XeO3 is being developed using SNASM as the assembler, and Minus4 as the debugger. Yape provides more realistic playback, and the uploader provides real hardware downloading! All I really need to do is finish the remote debugger and we'd have a full devkit!!
Tuesday, November 27, 2007
XeO3: Profiled!

The 2 big peaks to the right are the screen copy used for scrolling (but also wipes the display). Theres 2 seprate peaks as its double buffered and it flips from one to the other.
This is pretty good as it means code is taking its time in the areas expected; as is usually the case for 8bit stuff. However, I'll start looking at things like collision and zeropage next. Theres something funny happening in zeropage that I'll need to track down, it looks like something it over writing a couple of bytes of unallocated memory down there.
Oh...The reason I was able to pick this bit out is that I've impemented the ZOOM feature. So now all you do is click and drag over an area of interest and then click ZOOM. I'll need to change the Execute buffer as when you zoom in to byte level, it only counts the OPCODE bytes as being used. This means you get a peak, 0, peak, 0,0 peak etc. as the paramaters aren't tagged. All I need is a 256 byte table of how big each opcode is then fill in each location of an instruction.
Monday, November 26, 2007
Minus4: More on profiling....
You know, the one thing I really like about machines getting bigger and better, is that it lets you be lazy. In Minus4 I could do special functions to hunt quickly for symbols as quickly as possibly, arranging it all in a nice binary tree, while at the same time maintaining a 2D linked list so that I can find the symbol closest to an address.
Or.... being lazy and having a big machine....I can create a 256K table of symbol pointers.
I like lazy. Code is easy, and I can get onto what matters.
So I've only a couple of bits left of the Minus4 profiler. One is a ZOOM function; which it does actually do just now but I need a user interface, and the second is a symbol look up so that the addresses make sense to a developer. The blurb above means I can do the symbol lookup REALLY easily, so that will just leave the zoom and scroll bit (to let you view around the window area easily).
Then I can get back onto XeO3 and rearrange memory to be more efficiant.
Or.... being lazy and having a big machine....I can create a 256K table of symbol pointers.
I like lazy. Code is easy, and I can get onto what matters.
So I've only a couple of bits left of the Minus4 profiler. One is a ZOOM function; which it does actually do just now but I need a user interface, and the second is a symbol look up so that the addresses make sense to a developer. The blurb above means I can do the symbol lookup REALLY easily, so that will just leave the zoom and scroll bit (to let you view around the window area easily).
Then I can get back onto XeO3 and rearrange memory to be more efficiant.
Sunday, November 25, 2007
Minus4: Profiling other games!!

72 bytes appear to be set aside for the monty graphic in zero page, and as you run about it goes up and down in time. Really cool.
It also shows up some odd patterns, for example in one of Luca's demos, it looks like he's using ZeroPage oddly as something is reading through zeropage overtime, and the read bar runs up smoothly through memory.
On XeO3, you can clearly see where both the sprites and scroll occur in memory, AND you can tell when its drawing tiles as theres a noticable spike every few frames.
The thing a static image can't get over, is that fact that becasue its in realtime, you see spikes as they happen - and where! Really neat.
Great fun this :)
Minus4: Profiling.

The REALLY cool thing is that I can watch the profile in real time!! When selected a new window pops open and you can sit and watch any area of memory and see what the access is like. This is very very cool, and a tool I wish I had in my day to day development! The piccy on the right shows the profile in action and the bars bump up and down over time as the system hits memory differently. I have a reset option so that I can averate the profile over a little bit of time and clear it. This gives some really cool feed back.
What I really need to do now is allow symbol lookups so you can see where time is being spent. This shouldn't be too hard but will prove to be amazingly cool! I still have most of the editor functions to add, but even now I can see that vast areas of ZeroPage (which is shown) are virtually unused!
Of course, a huge spike does not mean that you HAVE to put something in zero page, as things like my frame sync variable gets hit thousands of times a second, but can be slow as its the end of a frame!But for the most part, if theres a spike in memory access, thats a good variable to move to ZeroPage if you can.
Saturday, November 24, 2007
Plus4: The expansion port...
Oh.... and as a little side note.... I was wondering.... The big problem with the plus4 is that theres no female edge connectors that now FIT the plus4. Sure we can make cards that plug into the machine, but we can't do THROUGH connectors. So I was wondering, why not make a new standard?
We could do a convertor that goes in the current port, but then expands into a new size; a new width that there ARE connectors for. Then we make the cards fit the new size - say the PC ISA card size, as these are big enough and easy to get (or something like that). This way you can add through connectors and allow cards to be connected together.
This means all we need is one card to plug into the expansion, and from then on we make stuff for the NEW port.
Other machines like the Spectrum and C64 can have through ports - like the MMC64 which still allows the retroreplay to be plugged in. That would be cool.
We could do a convertor that goes in the current port, but then expands into a new size; a new width that there ARE connectors for. Then we make the cards fit the new size - say the PC ISA card size, as these are big enough and easy to get (or something like that). This way you can add through connectors and allow cards to be connected together.
This means all we need is one card to plug into the expansion, and from then on we make stuff for the NEW port.
Other machines like the Spectrum and C64 can have through ports - like the MMC64 which still allows the retroreplay to be plugged in. That would be cool.
Subscribe to:
Posts (Atom)