Jump to content
IGNORED

Aquarius 320x200 Bitmap Graphics Hack


Bruce Abbott

Recommended Posts

Software is done! I now have all the features I wanted:-

 

- 63 character sets stored in ATMega1284 internal Flash ROM

- Character sets copied from ROM to RAM for display. Contents of RAM can be modified by user.

- Up to 8 character sets can be stored in PCG RAM simultaneously, with instant switching between them.

- Two 320x200 'bitmap' screens. Each screen consists of 4 character sets.

- Separate display and write selects - can write to one character set or screen while displaying another.

- Controlled by poking into 8 memory locations at the end of Aquarius color RAM.

 

CONTROL REGISTERS:
$37F8 14328 unlock (enables writing to PCG registers)
$37F9 14329 lock (prevents writing to PCG registers)
$37FA 14330 set display mode 0 = normal (256 characters), 1 = 320x200 'bitmap' screen
$37FB 14331 set display bank 0-7
$37FC 14332 set write bank 0-7
$37FD 14333 load character set 0-62
$37FE 14334 select character to write (in current write bank) 0-255
$37FF 14335 write pattern to character (auto increments to next row/character/bank after write)

 

The first screenshot shows a simple test program that displays all 256 characters 4 times to fill the screen, then loads 2 different custom character sets into banks 1 and 2 (bank 0 is the stock character set) and finally switches to 320x200 mode to display all 3 character sets at once.

 

Second screenshot shows the results. You can see how the character set changes at 1/4 screen intervals (every 256 characters). The bottom 1/4 of the screen shows random pixels because no character set was loaded into bank 3.

 

 

post-40459-0-47035700-1439613835_thumb.jpg

post-40459-0-61882900-1439613846_thumb.jpg

  • Like 5
Link to comment
Share on other sites

Next step is to finalize the pcb layout and get some boards made. I also need to fill up those 63 character sets!

 

Other things I want to work on include:-

 

1. Finish building the cartridge micro-expander

2. SD card interface (using CH376)

3. BASIC extensions for loading screens from tape or disk etc.

 

Right now I just have an unexpanded Aquarius, and I'm getting sick of having to type everything in from scratch each time I turn it on (I can use the PC as a tape recorder, but it's a pain to set up and operate).

 

I was holding off on building the micro-expander until the PCG project was complete because I didn't want to blow up the Aquarius before I got it working properly. Now that that's done there's no excuse...

  • Like 1
Link to comment
Share on other sites

All this sounds good to me :-D !

 

As for the re-typing issue, don't you have an old tape recorder from another computer lying around you could make use of? Martin has written on his website how to make a cable to get these connected to an Aquarius.

 

http://www.vdsteenoven.com/aquarius/casscable.html

 

Of course this is only for temporary usage until you have successfully completed the SD card interface.

 

And yes some new basic commands would be highly appreciated to get the most out of the new graphical capabilities.

 

Anyway good luck filling out those 63 character sets, because that sounds like a hell of a job to me ;-)!

 

Looking forward to see the finished boards to get my hands on one! ;-)

Edited by Aquaman
Link to comment
Share on other sites

Happy to see your progress, Bruce!

 

One thing I would request, with regard to the BASIC extensions: if you're planning to use $2000-$2FFF (the empty 4K space reserved for Extended BASIC), it would be very helpful if you could provide a way to disable the extensions and leave that 4K open for other purposes, perhaps via a jumper on the board. I'm working on a development cartridge which will need to make use of this space, and I'm sure that other projects will use it it, too.

  • Like 1
Link to comment
Share on other sites

As for the re-typing issue, don't you have an old tape recorder from another computer lying around you could make use of?

I am making a cable that converts a Commodore 64 datasette into a generic tape recorder. Once I get that going I want to write faster tape routines that flash the border like a ZX Spectrum.

Link to comment
Share on other sites

Happy to see your progress, Bruce!

 

if you're planning to use $2000-$2FFF (the empty 4K space reserved for Extended BASIC), it would be very helpful if you could provide a way to disable the extensions

Most of the extensions I want are generic and some are already in BLBASIC, so I am looking at adding them to it rather than creating my own ROM from scratch. Anything I put into the $2000-$2FFF area will just be for my own personal use (right now its easier to put code there because I have a Flash ROM in the socket - just need a 'CALL' keyword in BASIC so I don't have to poke those 2 user function bytes every time!).

 

What will your development cartridge do?

 

Any chance you could supply some character sets for my PCG project?

Link to comment
Share on other sites

How about working together to come up with a method of identifying what is in the Extended BASIC area and how to map it in/out. Perhaps some kind of data block can be inserted that contains fields such as :-

  • Bank name, year of manufacture, copyright etc.
  • I/O address to write bank select value to
  • Bank select format
  • No of banks supported
Then you could have some kind of "ROMCAT" command that could go through all the banks and display information about them. Internal mods should by default be enabled first and then "ROMCAT" can go off and look at what else is available.
Link to comment
Share on other sites

Most of the extensions I want are generic and some are already in BLBASIC, so I am looking at adding them to it rather than creating my own ROM from scratch. Anything I put into the $2000-$2FFF area will just be for my own personal use (right now its easier to put code there because I have a Flash ROM in the socket - just need a 'CALL' keyword in BASIC so I don't have to poke those 2 user function bytes every time!).

 

What will your development cartridge do?

 

Any chance you could supply some character sets for my PCG project?

I was working on some alternate character sets for my SuperFont project, so if you like, I can dig those out and send them to you.

 

The development cartridge will make it easier to test new cartridge-based software on a real Aquarius; it's part of a kit which includes a USB interface cable for the Mini Expander that I'm also working on. It contains two types of memory: a 512K RAM banked into the program cartridge space ($C000-$FFFF), and a Flash ROM banked into the Extended BASIC space ($2000-$2FFF). The ROM will initially have some simple communication software built in, so when you boot the Aquarius, you'll be able to use the USB interface to download a program cartridge binary from a PC into the RAM, and then warm-boot the Aquarius to test it. I need the Extended BASIC area for this because the Aquarius OS always looks there for a valid ROM first, before it checks to see if a program cartridge is present.

  • Like 1
Link to comment
Share on other sites

How about working together to come up with a method of identifying what is in the Extended BASIC area and how to map it in/out. Perhaps some kind of data block can be inserted that contains fields such as :-

  • Bank name, year of manufacture, copyright etc.
  • I/O address to write bank select value to
  • Bank select format
  • No of banks supported
Then you could have some kind of "ROMCAT" command that could go through all the banks and display information about them. Internal mods should by default be enabled first and then "ROMCAT" can go off and look at what else is available.

That's an interesting idea. If I remember correctly, the Aquarius OS checks to see if Extended BASIC is present by looking for a particular five-byte sequence from $2000-$2004; if it finds it, it jumps directly to $2005. My original idea for using that 4K Extended BASIC area was to bank a 512K ROM into it, divided into 256 banks of 2K each. The first 2K would be fixed to Bank #00 (that's where the five-byte sequence, startup code, and jump tables for our BASIC extensions would be kept), but the last 2K could be switched to any of the other banks. This is how I planned to add Extended BASIC and other goodies to my Mini Expander II.

 

Perhaps it would be possible to elaborate upon that idea and add the "ROMCAT" functionality to the startup code in that first bank: it could swap in all the other 2K banks and take inventory of whatever it finds. These other banks can contain any kind of code we want (Bruce's BASIC extensions for reprogrammable graphics, BLBasic, diagnostic software, the USB communication software from my development cartridge, etc), so the possibilities for extending the Aquarius OS into something much more sophisticated than Microsoft BASIC are pretty exciting.

Link to comment
Share on other sites

I am making a cable that converts a Commodore 64 datasette into a generic tape recorder. Once I get that going I want to write faster tape routines that flash the border like a ZX Spectrum.

I should have known you are already working on something like this. ;) As for the faster tape routines, I guess you are going to make it surpassing the speed and user-friendliness of the old Turboloader? http://www.vdsteenoven.com/aquarius/turbo.php

Turbo.rar

Link to comment
Share on other sites

Most of the extensions I want are generic and some are already in BLBASIC, so I am looking at adding them to it rather than creating my own ROM from scratch. Anything I put into the $2000-$2FFF area will just be for my own personal use (right now its easier to put code there because I have a Flash ROM in the socket - just need a 'CALL' keyword in BASIC so I don't have to poke those 2 user function bytes every time!).

 

An extension of BLBasic instead of another individual ROM would be highly appreciated. We really need some kind of compatible system setup, which can be expanded gradually to everyone's own needs.

Link to comment
Share on other sites

We're thinking along the same lines! One of my character sets includes an 8x8 "running man" figure very much like the one in the Odyssey2 set. I've also got space shapes, map shapes, alternative fonts with lots of math symbols, and even a complete set of Chess graphics. I just rebuilt my computer, so it may take time to find them, but I'll post what I have when I do.

  • Like 2
Link to comment
Share on other sites

Some other (game)font related sites I found:

http://fontvir.us/fonts/8bit

http://www.onextrapixel.com/2013/04/08/25-free-pixel-perfect-fonts-for-8-bit-designs/

http://fontstruct.com/gallery/tag/6087/Intellivision

 

Adittionally I attached the font file from the MZ-700. Maybe it is even an option to try and take some character roms from the MESS supported computers, what do you think?

http://ia801903.us.archive.org/zipview.php?zip=/3/items/MESS-0.151.BIOS.ROMs/MESS-0.151.BIOS.ROMs.zip

 

 

 

mz700fge.zip

Link to comment
Share on other sites

A bit more ambitious but how about ZX-81 + Chroma emulation?

 

http://www.fruitcake.plus.com/Sinclair/ZX81/Chroma/ChromaInterface_GraphicsSupport.htm

 

".....In a standard ZX81, the pixel patterns defining each character can only exist within the ROM. Two manufacturers (dk'tronics and Kayde Electronic Systems) sold a board that could to be fitted inside the ZX81 to equip it with an additional 4K of ROM containing 7 alternate character sets. In their advertising, this board was simply referred to as a Graphics ROM. Out of the 7 alternate character sets, 6 were identical between the Kayde and dk'tronics ROMs. The 4K ROM was decoded to appear immediately after the BASIC ROM in the memory map, in a region not normally populated in a ZX81 system...."

Link to comment
Share on other sites

Some of the graphics in my SuperFont character sets were inspired by the characters that were included with those ZX81 upgrades. I ran across their character sets some years ago, and I thought it would be nice to extend that idea to include multiple "themed" character sets for the Aquarius (a set of space graphics with a "futuristic" alphanumeric font for space games, a set of map graphics with a "military" font for strategy games, etc). So, even though Bruce's upgrade works quite differently from the ZX81 upgrades, you'll see the same characters (and then some!).

  • Like 2
Link to comment
Share on other sites

Great progress! Out of the box comment: have you tested various pixel patterns on NTSC to see if there is any color artifacting?

I have now. ;)

 

The screen below is only two colors - black and white - but with characters redefined as as combinations of vertical lines with varying thicknesses. Some combinations produce strong color bands in NTSC. The solid green and purple are alternating single pixel vertical lines (10101010 and 01010101).

  • Like 2
Link to comment
Share on other sites

Great progress! Out of the box comment: have you tested various pixel patterns on NTSC to see if there is any color artifacting?

I have now. ;)

 

The screen below is only two colors - black and white - but with characters redefined as as combinations of vertical lines with varying thicknesses. Some combinations produce strong color bands in NTSC. The solid green and purple are alternating single pixel vertical lines (10101010 and 01010101).

post-40459-0-28458500-1440397224_thumb.jpg

Edited by Bruce Abbott
  • Like 5
Link to comment
Share on other sites

I have now. ;)

 

The screen below is only two colors - black and white - but with characters redefined as as combinations of vertical lines with varying thicknesses. Some combinations produce strong color bands in NTSC. The solid green and purple are alternating single pixel vertical lines (10101010 and 01010101).

Looking at the solid purple and green colours gives an effective 160x192 4 colour resolution. Do you get different colours by changing foreground and background - 255 combinations?!

 

Sent from my D5803 using Tapatalk

Link to comment
Share on other sites

Looking at the solid purple and green colours gives an effective 160x192 4 colour resolution. Do you get different colours by changing foreground and background - 255 combinations?!

 

Sent from my D5803 using Tapatalk

I tried all 255 bit combinations and couldn't get more colors than what you can see in the screenshot. Perhaps a few more might come out with dither patterns, but I think 4 solid colors is the max without doing half-bit shifting like the Apple II.

 

EDIT: You mean change the color foreground/background colors as well? I suspect that would negate the artifacting effect (which relies on pure white/black with no actual chrominance signal to override it).

Edited by Bruce Abbott
  • Like 2
Link to comment
Share on other sites

I tried all 255 bit combinations and couldn't get more colors than what you can see in the screenshot. Perhaps a few more might come out with dither patterns, but I think 4 solid colors is the max without doing half-bit shifting like the Apple II.

 

EDIT: You mean change the color foreground/background colors as well? I suspect that would negate the artifacting effect (which relies on pure white/black with no actual chrominance signal to override it).

Do you think 4 colours using artifact could be used with the standard 2 color attributes graphics? Create standard graphics then exploit artifacts in select places.

 

If I were to mock up some examples in 320x192 how easy could you convert to test?

 

Obviously going forward maybe some extra logic would be required for PAL systems but it could feasibly provide an extra graphic mode

 

Sent from my D5803 using Tapatalk

Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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...