Tempest is possible

Use this forum to share and discuss Uzebox games and demos.
CunningFellow
Posts: 1445
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Tempest is possible

Post by CunningFellow »

Someone please test this on real hardware. It works in the simulator and the emulator.

It should be a lot of blue stripes with a series of coloured pixels on the first line.

The blue stripes are the background. Because I have no SD card action yet I am going

Code: Select all

     ldi r18, 0x01      ; Load 0b00000001  to show a blue stripe
     nop
which gives the blue stripes instead of the

Code: Select all

     in     r18, _SFR_IO_ADDR(SPDR)     ; Get a byte from the SD card for the 1bpp background bitmap
     out    _SFR_IO_ADDR(SPDR), r14     ; que the next byte to read from the SD card in 40 clocks time
which should be able to give me a 1bpp background when I get the SD card running.

The coloured pixels are all 16 possible combinations that one nibble in 2bpp ramTiles gives

YY
RY
GY
CY
YR
RR
GR
CR
YG
RG
GG
CG
YC
RC
GC
CC

Where Y=Yellow, R=Red, G=Green and C=Clear (the background colour either blue or black)

If that works on real hardware then I shall put my thumbs up and say "great success". That is the HARD part of tempest nailed.

It only takes 12,000 lines of ASM code to do it as well.
Attachments
TempestRenderTest.hex
(73.72 KiB) Downloaded 503 times
CunningFellow
Posts: 1445
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Tempest is possible

Post by CunningFellow »

OH - I just thought of another silly trick.

I only have 2 clock cycles spare every 40 to read the BMP image.

That is enough to do the SPI reading of the SD card and is enough to draw the striped background in the last HEX file.

It's not enough to read the BMP from ROM or RAM as I have used up all the 16 bit pointer registers.

However POP only takes 2 clock cycles :)

So I can use the front and back porch to read a BMP from FLASH and PUSH them onto the stack. Then during render I can POP them off the stack in 2 clocks :D

Have a look at this one if the blue stripes didn't float your boat. (Again with the 16 pixel map on the first line)

Yes I did just draw that BMP free hand in photoshop and convert it to C code using "image2code".

The final game can not use this idea though. As each web would take 7KB. There are 16 webs in the game. I don't have 49KB spare after the ridiculous render_line routine.
Attachments
TempestBitmap.hex
(94.11 KiB) Downloaded 498 times
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Tempest is possible

Post by uze6666 »

I'd like to check it out, alas, all my kits are still packed from my recent moving. If someone else else could test it that would be great, otherwise it will take a couple days for me.
User avatar
D3thAdd3r
Posts: 3222
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Tempest is possible

Post by D3thAdd3r »

heh :oops: am I missing something? Is this supposed to run on the standard emulator, or one with new things emulated? Not sure if I made a bad .uze file or what but my tv wont sync with it. Looks like you don't actually expect anything on the SD card yet right? I will try and see if I did something stupid
CunningFellow
Posts: 1445
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Tempest is possible

Post by CunningFellow »

D3thAdd3r,

It needs the newest version of the emulator that Uze fixed up to support Timmer1 Overflow Interrupt.

Nothing needed on the SD card yet.

I am not 100% sure of the timing in the BMP version (three posts above) but the stripes one (four posts above) does have the correct number of clocks between events in the simulator.
Karl_A
Posts: 6
Joined: Mon Jun 08, 2009 10:57 pm

Re: Tempest is possible

Post by Karl_A »

When I try it on my hardware I get a blank screen
I used the TempestRenderTest.hex
Last edited by Karl_A on Sat Jul 20, 2013 3:18 am, edited 1 time in total.
User avatar
D3thAdd3r
Posts: 3222
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Tempest is possible

Post by D3thAdd3r »

I formatted my card and made sure my conversion process was right for packrom on a known working. My tv doesn't sync even for a moment when I load it. Wish that was more helpful, probably some small thing going on there

edit - I used the TempestRenderTest.hex
User avatar
D3thAdd3r
Posts: 3222
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Tempest is possible

Post by D3thAdd3r »

What did you end up doing with the "free cycles" before and after the visible scanline. I have not messed with video modes in a while so I don't know what I'm saying here, but you still have the HSync pulses going on right?
CunningFellow
Posts: 1445
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Tempest is possible

Post by CunningFellow »

mmm - i better hurry up and build my hardware and see what the problem is.

Thanks for trying.
CunningFellow
Posts: 1445
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Tempest is possible

Post by CunningFellow »

D3thAdd3r wrote:What did you end up doing with the "free cycles" before and after the visible scanline. I have not messed with video modes in a while so I don't know what I'm saying here, but you still have the HSync pulses going on right?
YES - Sync is still there (or the emulator would not make a picture :)

Because I am doing 5clk per pixel and only using 256 rather than 288 pixels, I have 160 extra clock cycles free per scan line. I was using them to load a BMP from FLASH and POP them onto the stack in RAM.
Post Reply