VEXED

Post Reply
User avatar
Iggypop
Posts: 192
Joined: Thu Mar 05, 2020 6:34 pm
Location: The Netherlands
Contact:

VEXED

Post by Iggypop »

A new game based on the game VEXED (http://vexed.sourceforge.net/).

Vexed is a puzzle game in which you need to clear all blocks. You can move blocks left or right. Blocks fall to the ground
if you push them over a ledge. Blocks disappear when two or more of the same blocks touch each other.
The second objective is to clear all blocks within a minimum of moves.
There are 8 sets of puzzle packs, each successive set more difficult than the other.. The last two variety packs progress from medium to hard in difficulty.

You control the cursor with Z:Left X:Right ::Up /:Down Return=(de)select
S will show you the solution.. R will reset the level if you are stuck. Q will quit the game and the current progress will be saved.

If you like this game, check here for some future updates to the game.

The game is compatible with bbc model B/B+, master & master compact and the Electron, IF you have a disk filing system fitted. It will not run from cassette.

The game needs write access to the diskette, ...or disk image if you play this game in an emulator.

See the game on youtube: https://youtu.be/MGSJ-0mtyW4

Special thanks to TobyLobster for enhancing the sprite routine and to all community members who have given advice and/or input

Get the latest version here !
vexed.dsd
(400 KiB) Downloaded 42 times
version 01.05.2023

If you are upgrading from a previous version and you want to restore your game progress from the older version, just copy the A1, B1, C1....F1-files over...

HAPPY VEXING

Igor Wollersheim
Attachments
VEXED.jpg
Last edited by Iggypop on Tue May 02, 2023 8:41 am, edited 31 times in total.
Igor

Acorn Electron, BBC Master 128, Acorn Archimedes A3000
User avatar
FourthStone
Posts: 1527
Joined: Thu Nov 17, 2016 2:29 am
Location: Brisbane, Australia
Contact:

Re: VEXED

Post by FourthStone »

Great game! Look forward to working through the puzzles =D>
User avatar
Cybershark
Posts: 736
Joined: Wed Jun 14, 2006 11:16 pm
Contact:

Re: VEXED

Post by Cybershark »

It's all looking wonderful now, although I did prefer the rotational screen wipe effect between levels :lol:

Dunno why this never occurred to me before, but it's actually quite odd to have the cursor start in the extreme top left of the outer border, as that is outside of the gameplay area. There's just never any reason for it to be that far out. Would make more sense for it to originate at "1,1" rather than "0,0". Just a minor observation :)
User avatar
Iggypop
Posts: 192
Joined: Thu Mar 05, 2020 6:34 pm
Location: The Netherlands
Contact:

Re: VEXED

Post by Iggypop »

I seek your wisdom...

i want to implement a wait instruction in assembly. How do i go about it? i want to time the animation of a sprite. i do not
want to use interrupts.. So i need a timer that i can poll... I'm thinking about a timer of the user via.. I can't figure out how to do that
at the moment..

I'm looking for an equivalant of this
TIME=0: DO STUFF : REPEAT UNTIL TIME>20

into assembler
.reset_timer
...
RTS

.wait_for_timer

BNE wait_for_timer (if timer has not passend X centiseconds)
Igor

Acorn Electron, BBC Master 128, Acorn Archimedes A3000
User avatar
tricky
Posts: 7694
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: VEXED

Post by tricky »

If you have the os, you can do *fx19 or whatever it is for wait for v sync.
You could use the one shot timer on the user via by setting the time and waiting for the interrupt flash on the via to signal. I don't know if the timer actually stopped in one shot mode, it just only fires once but I suspect the latter. You would have to check that the OS doesn't get there before you.
If it was very short, you could wait with interrupts disabled SEI.
User avatar
jgharston
Posts: 5319
Joined: Thu Sep 24, 2009 12:22 pm
Location: Whitby/Sheffield
Contact:

Re: VEXED

Post by jgharston »

Iggypop wrote: Fri Oct 28, 2022 2:22 pm I want to implement a wait instruction in assembly.

I'm looking for an equivalent of this
TIME=0: DO STUFF : REPEAT UNTIL TIME>20
Which do you want? Wait, or loop and do stuff?

If you want to /wait/, use OSBYTE 19, T%=TIME+offset:REPEAT:UNTIL TIME>T%
LDX #clicks
LDA #19
.loop
JSR OSBYTE:DEX:BNE loop :\ wait for 'clicks' 50Hz VSyncs

If you want to /do until.../, T%=TIME+offset:REPEAT:do stuff:do stuff:do stuff:UNTIL TIME>T%
LDX #timer1 AND 255
LDY #timer1 DIV 256
LDA #1:JSR OSWORD :\ Read TIME
CLC
LDA #delay AND &FF:ADC timer1+0:STA timer1+0 :\ timer1=now+offset into future
LDA #(delay AND &FF00)DIV&100:ADC timer1+1:STA timer1+1
LDA #(delay AND &FF0000)DIV&10000:ADC timer1+2:STA timer1+2
LDA #(delay AND &FF000000)DIV&1000000:ADC timer1+3:STA timer1+3
.loop
\ do stuff
\ do stuff
\ do stuff
LDX #timer2 AND 255
LDY #timer2 DIV 256
LDA #1:JSR OSWORD :\ Read TIME
LDX #0:LDY #5
SEC
.subtract
LDA timer1,X:SBC timer2,X :\ now-future
INX:DEY:BNE subtract
BCC loop :\ now is still in the past relative to future, keep looping

All errors entirely my own. Note, TIME is in 100th sec, VSync is in 50th sec.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.45
(C) Copyright J.G.Harston 1989,2005-2024
>_
User avatar
Iggypop
Posts: 192
Joined: Thu Mar 05, 2020 6:34 pm
Location: The Netherlands
Contact:

Re: VEXED

Post by Iggypop »

Thanx for the help. I used the last method..

Code: Select all

.set_timer                      ;set 20millisecond timer
{
    LDA #1
    LDX #timer1 MOD 256
    LDY #timer1 DIV 256
    JSR &FFF1
    CLC
    LDA timer1
    ADC #20 
    STA timer1
    LDA timer1+1
    ADC #0
    STA timer1+1
    RTS
}
.check_timer                    ;wait until set time has passed 
{
    LDA #1
    LDX #timer2 MOD 256
    LDY #timer2 DIV 256
    JSR &FFF1
    SEC
    LDA timer1
    SBC timer2
    LDA timer1+1
    SBC timer2+1
    BCS check_timer             ;Carry is cleared on a negative result. 
    RTS
}
Last edited by Iggypop on Sun Nov 13, 2022 5:08 pm, edited 1 time in total.
Igor

Acorn Electron, BBC Master 128, Acorn Archimedes A3000
User avatar
Iggypop
Posts: 192
Joined: Thu Mar 05, 2020 6:34 pm
Location: The Netherlands
Contact:

NEW VERSION OF VEXED

Post by Iggypop »

I'm very proud to present my newest version of my game. A lot of work has been done on the machine code part. I did a complete rewrite.
All sprite animation is done from the assembler code. this results in a flicker free animation. You will also notice that the cursor behaves a little
different. Most notable is the LOGO on top of the screen..

VEXED.jpg
Get your new version above, at the beginning of the thread. More levels are comming soon..
If you want to restore your game progres from the older version, just copy the A1, B1, C1, D1-files over...
Last edited by Iggypop on Sat Nov 05, 2022 11:05 am, edited 2 times in total.
Igor

Acorn Electron, BBC Master 128, Acorn Archimedes A3000
User avatar
Cybershark
Posts: 736
Joined: Wed Jun 14, 2006 11:16 pm
Contact:

Re: VEXED

Post by Cybershark »

Hey, I see you moved the initial cursor position in from the outer border (as per my suggestion) but what I meant was that the cursor has no reason to ever then move into the outer border. I just think it would look slightly more professional if you reduced the movement area for it by 1 unit on each side.

And is there any way that the in-game block sprites could be made to look as vibrant as the ones that you have the title logo made up from? I think that would elevate the game so much :)
User avatar
Iggypop
Posts: 192
Joined: Thu Mar 05, 2020 6:34 pm
Location: The Netherlands
Contact:

Re: VEXED

Post by Iggypop »

There are levels that have blocks on the edges, there are only a few, but they do exist. :D
Igor

Acorn Electron, BBC Master 128, Acorn Archimedes A3000
User avatar
Iggypop
Posts: 192
Joined: Thu Mar 05, 2020 6:34 pm
Location: The Netherlands
Contact:

Re: VEXED

Post by Iggypop »

New release with exta level packs

Twister levels and the IMPOSSIBLE Pack
Minor updates to the intro program

Get the new version at the first post in this thread
Last edited by Iggypop on Fri Nov 04, 2022 6:59 am, edited 3 times in total.
Igor

Acorn Electron, BBC Master 128, Acorn Archimedes A3000
User avatar
Iggypop
Posts: 192
Joined: Thu Mar 05, 2020 6:34 pm
Location: The Netherlands
Contact:

Re: VEXED

Post by Iggypop »

The way that the sprites are drawn allows for them be be composed of two seperate sprites in any logical colour. I can't draw sprite with 3 colours.
So what pattern / figure would you suggest for a "selected" block..(make up the background of the selected block) ?
Igor

Acorn Electron, BBC Master 128, Acorn Archimedes A3000
User avatar
TobyLobster
Posts: 618
Joined: Sat Aug 31, 2019 7:58 am
Contact:

Re: VEXED

Post by TobyLobster »

A couple of small typos: "INSTRUNCTIONS" should be "INSTRUCTIONS" on the first screen, and the last word of the instructions should be "progress" not "progres"
User avatar
Iggypop
Posts: 192
Joined: Thu Mar 05, 2020 6:34 pm
Location: The Netherlands
Contact:

Re: VEXED

Post by Iggypop »

typo's corrected. :D
Igor

Acorn Electron, BBC Master 128, Acorn Archimedes A3000
Michael Brown
Posts: 2609
Joined: Sat Apr 03, 2010 1:54 pm
Location: Nottingham
Contact:

Re: VEXED

Post by Michael Brown »

Hi,
There is another typo at line 770 with "encoutered".

Excellent game!
Mick.
User avatar
Iggypop
Posts: 192
Joined: Thu Mar 05, 2020 6:34 pm
Location: The Netherlands
Contact:

Re: VEXED

Post by Iggypop »

fixed typo.. fixed a little "bug" where the logo was was displayed in solid background colours instead of triangles.
Igor

Acorn Electron, BBC Master 128, Acorn Archimedes A3000
User avatar
Cybershark
Posts: 736
Joined: Wed Jun 14, 2006 11:16 pm
Contact:

Re: VEXED

Post by Cybershark »

Iggypop wrote: Thu Nov 03, 2022 3:39 pm There are levels that have blocks on the edges, there are only a few, but they do exist. :D
Ok, didn't realise, sorry!
Iggypop wrote: Thu Nov 03, 2022 3:46 pm The way that the sprites are drawn allows for them be be composed of two seperate sprites in any logical colour. I can't draw sprite with 3 colours.
So what pattern / figure would you suggest for a "selected" block..(make up the background of the selected block) ?
I see the problem. Ok, well it wasn't such a big deal anyway 😂

I did notice one oversight. The Twister Levels don't seem to have solutions included - or at least the first level won't auto-solve.
User avatar
Iggypop
Posts: 192
Joined: Thu Mar 05, 2020 6:34 pm
Location: The Netherlands
Contact:

Re: VEXED

Post by Iggypop »

The first update had an error in the twister level data. It has been corrected. Download the latest version. 07.11.2022.
Last edited by Iggypop on Mon Nov 07, 2022 1:54 pm, edited 1 time in total.
Igor

Acorn Electron, BBC Master 128, Acorn Archimedes A3000
User avatar
Iggypop
Posts: 192
Joined: Thu Mar 05, 2020 6:34 pm
Location: The Netherlands
Contact:

Re: VEXED

Post by Iggypop »

Twister levels had an error. I thought it had been fixed, but wasn't the case. it has been corrected now. :D :D
Igor

Acorn Electron, BBC Master 128, Acorn Archimedes A3000
User avatar
Iggypop
Posts: 192
Joined: Thu Mar 05, 2020 6:34 pm
Location: The Netherlands
Contact:

Re: VEXED

Post by Iggypop »

This is the code for the new spriteroutine used in vexed 2.0

Code: Select all

\ ******************************************************************
\ *	Zero page vars 
\ ******************************************************************

ORG &70
GUARD &9F

.spritenum          skip 1
.x                  skip 1
.y                  skip 1
.foreground_colour  skip 1  
.background_colour  skip 1  
.scrnaddr           skip 2
.scrnaddr_8         skip 2
.spriteaddr         skip 2
.x_count            skip 1
.y_count            skip 1
.t1                 skip 1  ;temp
.t2                 skip 1
.t3                 skip 1
.t4                 skip 1
.high_nibble        skip 1
.low_nibble         skip 1
.colour             skip 1

\ ******************************************************************
\ *	Code 
\ ******************************************************************

ORG &2DA0
GUARD &3000

.start

.main

LDA spritenum       ;setup the spriteaddress
ASL A
TAX
LDA sprite,X 
STA spriteaddr
LDA sprite+1,X 
STA spriteaddr+1
JSR calcscraddr     ;calculate the screenaddress
LDA #19
JSR &FFF4           ;*FX 19 wait for vertical sync
JSR drawsprite
RTS

\ the sprites are coded as 1 bit per pixel. 
\ in MODE 1 there are four pixels in every byte
.drawsprite
{
    LDX #0
    LDA #2
    STA y_count
     .looprow 
    LDA #2 
    STA x_count
    .loopcol
    LDY #0
    .loopchar
    LDA foreground_colour
    STA colour
    CMP #0
    BEQ colour_0
    STA colour
    LDA (spriteaddr),Y 
    STA t1
    AND #&F0                ;Isolate the high nibble   
    STA high_nibble         ;is logical colour 2 by default
    LDA (spriteaddr),Y 
    AND #&0F                ;Isolate the low nibble
    STA low_nibble          ;is logical colour 1 by default
    JSR colouring
    LDA background_colour   
    CMP #0
    BEQ draw
    STA colour              ;if backgound colour is not black add an second colour
    LDA low_nibble
    STA t3
    LDA high_nibble
    STA t4
    LDA t1
    EOR #&FF               ;NOT
    AND background_mask_1,X
    STA t2 
    AND #&F0
    STA high_nibble
    LDA t2
    AND #&0F 
    STA low_nibble
    JSR colouring
    LDA t4
    ORA high_nibble
    STA high_nibble
    LDA t3
    ORA low_nibble
    STA low_nibble
    JMP draw
    .colour_0
    LDA #0
    STA high_nibble
    STA low_nibble    
    .draw
    LDA high_nibble
    STA (scrnaddr),Y 
    LDA low_nibble
    STA (scrnaddr_8),Y 
    INX
    INY
    CPY #8
    BNE loopchar
    JSR next_char
    DEC x_count
    BNE loopcol
    JSR next_row
    DEC y_count
    BNE looprow
    RTS
}

 
.colouring 
{
    LDA colour
    CMP #1
    BEQ colour_1
    CMP #2
    BEQ colour_2
    .colour_3
    LDA high_nibble
    LSR A 
    LSR A 
    LSR A 
    LSR A 
    ADC high_nibble
    STA high_nibble
    LDA low_nibble
    ASL A 
    ASL A 
    ASL A
    ASL A 
    ADC low_nibble
    STA low_nibble
    RTS
    .colour_2       ;remember high_nibble is already in colour 2
    LDA low_nibble
    ASL A 
    ASL A 
    ASL A 
    ASL A 
    STA low_nibble
    RTS
    .colour_1       ;remember low_nibble is already in colour 1
    LDA high_nibble
    LSR A 
    LSR A 
    LSR A 
    LSR A
    STA high_nibble
    RTS
}

 .calcscraddr
{
    LDA y              ;calculate rowadress
    ASL A
    TAX
    LDA screen,X 
    STA scrnaddr
    LDA screen+1,x
    STA scrnaddr+1
    LDA #0             ;calculate columnadress
    STA t1
    STA t2
    LDA x 
    STA t1
    CLC                
    ASL t1              ; x * 8
    ROL t2
    ASL t1 
    ROL t2 
    ASL t1
    ROL t2
    LDA scrnaddr
    ADC t1
    STA scrnaddr
    LDA scrnaddr+1
    ADC t2
    STA scrnaddr+1
    LDA scrnaddr
    ADC #8
    STA scrnaddr_8
    LDA scrnaddr+1
    ADC #0
    STA scrnaddr_8+1
    RTS
}

 .next_char             
{
    CLC
    LDA scrnaddr
    ADC #16
    STA scrnaddr
    LDA scrnaddr+1
    ADC #0
    STA scrnaddr+1
    LDA scrnaddr_8
    ADC #16
    STA scrnaddr_8
    LDA scrnaddr_8+1
    ADC #0
    STA scrnaddr_8+1
    LDA spriteaddr
    ADC #8
    STA spriteaddr
    LDA spriteaddr+1
    ADC #0
    STA spriteaddr+1
    RTS
}

 .next_row
{
    LDA scrnaddr
    ADC #&60
    STA scrnaddr
    LDA scrnaddr+1
    ADC #2
    STA scrnaddr+1
    LDA scrnaddr_8
    ADC #&60
    STA scrnaddr_8
    LDA scrnaddr_8+1
    ADC #2
    STA scrnaddr_8+1
    RTS
}

.slide_left
{
    JSR move_left
    JSR wait
    JSR move_left
    JSR wait
    JSR move_left
    JSR wait
    JSR move_left
    RTS
}

.slide_right
{
    JSR move_right
    JSR wait
    JSR move_right
    JSR wait
    JSR move_right
    JSR wait
    JSR move_right
    RTS
}

.fall_down
{
    JSR move_down
    JSR wait
    JSR move_down
    RTS
}

 .move_left
{
    DEC x               ;move left
    JSR main
    SEC
    LDA scrnaddr
    SBC #&E0 
    STA scrnaddr
    LDA scrnaddr+1
    SBC #&4
    STA scrnaddr+1
    JSR clear_side
    RTS    
}

.move_right
{
    INC x 
    JSR main
    SEC
    LDA scrnaddr
    SBC #&08
    STA scrnaddr
    LDA scrnaddr+1
    SBC #&5
    STA scrnaddr+1  
    JSR clear_side
    RTS
}

 .clear_side
{
    LDA #19
    JSR &FFF4           ;*FX 19 wait for vertical sync
    LDX #2
    .loop1
    LDY #0
    .loop2
    LDA #0
    STA (scrnaddr),Y 
    INY
    CPY #8
    BNE loop2
    CLC
    LDA scrnaddr
    ADC #&80
    STA scrnaddr
    LDA scrnaddr+1
    ADC #2
    STA scrnaddr+1
    DEX
    BNE loop1
    RTS
}

.move_down
{
    JSR calcscraddr
    LDY #0
    .loop 
    LDA #0
    STA (scrnaddr),Y 
    INY
    CPY #32
    BNE loop
    INC y 
    JSR main
    RTS
}

.wait
{
    JSR set_timer
    JSR check_timer
    RTS
}

.set_timer                      ;set 20millisecond timer
{
    LDA #1
    LDX #timer1 MOD 256
    LDY #timer1 DIV 256
    JSR &FFF1
    CLC
    LDA timer1
    ADC #15 
    STA timer1
    LDA timer1+1
    ADC #0
    STA timer1+1
    RTS
}
.check_timer                    ;wait until set time has passed 
{
    LDA #1
    LDX #timer2 MOD 256
    LDY #timer2 DIV 256
    JSR &FFF1
    SEC
    LDA timer1
    SBC timer2
    LDA timer1+1
    SBC timer2+1
    BCS check_timer             ;Carry is cleared on a negative reslut. 
    RTS
}
.timer1         skip 5
.timer2         skip 5
.end
\ ******************************************************************
\ *	Data 
\ ******************************************************************
ORG &900

\ *	Spritedata 1bit per pixel
.data1
EQUD &EAD5FF7F : EQUD &EAD5EAD5
EQUD &AB57FFFE : EQUD &AB57AB57
EQUD &EAD5EAD5 : EQUD &7FFFEAD5
EQUD &AB57AB57 : EQUD &FEFFAB57
.data2
EQUD &C1C0FF7F : EQUD &DFCFC7C3
EQUD &8383FFFE : EQUD &FBF38383
EQUD &C1C1CFDF : EQUD &7FFFC1C1
EQUD &C3E3F3FB : EQUD &FEFF0383
.data3
EQUD &C3C3FF7F : EQUD &FCFCC3C3
EQUD &C3C3FFFE : EQUD &3F3FC3C3
EQUD &C3C3FCFC : EQUD &7FFFC3C3
EQUD &C3C33F3F : EQUD &FEFFC3C3
.data4
EQUD &C3C0FF7F : EQUD &D8D8CCC7
EQUD &C303FFFE : EQUD &1B1B33E3
EQUD &C7CCD8D8 : EQUD &7FFFC0C3
EQUD &E3331B1B : EQUD &FEFF03C3
.data5
EQUD &D8C0FF7F : EQUD &C0C0C0D8
EQUD &1B03FFFE : EQUD &0303031B
EQUD &D8C0C0C0 : EQUD &7FFFC0D8
EQUD &1B030303 : EQUD &FEFF031B
.data6
EQUD &CFC0FF7F : EQUD &C6CCD8DF
EQUD &F303FFFE : EQUD &63331BFB
EQUD &C1C1C1C3 : EQUD &7FFFC0C1
EQUD &838383C3 : EQUD &FEFF0383
.data7
EQUD &D8C0FF7F : EQUD &C3C7CEDC
EQUD &1B03FFFE : EQUD &C3E3733B
EQUD &DCCEC7C3 : EQUD &7FFFC0D8
EQUD &3B73E3C3 : EQUD &FEFF031B
.data8
EQUD &C0C0FF7F : EQUD &CCCCCFCF
EQUD &0303FFFE : EQUD &3333F3F3
EQUD &CFCFCCCC : EQUD &7FFFC0C0
EQUD &F3F33333 : EQUD &FEFF0303
.data9
EQUD &C0C0FF7F : EQUD &CFC7C7C1
EQUD &0303FFFE : EQUD &F3E3E383
EQUD &C1C7C7CF : EQUD &7FFFC0C0
EQUD &83E3E3F3 : EQUD &FEFF0303
.data10
EQUD &C0C0FF7F : EQUD &C0C0C0C0
EQUD &0303FFFE : EQUD &03030303
EQUD &C0C0C0C0 : EQUD &7FFFC0C0
EQUD &03030303 : EQUD &FEFF0303
.sprite
EQUW data1
EQUW data2
EQUW data3
EQUW data4
EQUW data5
EQUW data6
EQUW data7
EQUW data8
EQUW data9
EQUW data10
.background_mask_1
EQUD &3F3F0000 : EQUD &3F3F3F3F
EQUD &FCFC0000 : EQUD &FCFCFCFC
EQUD &3F3F3F3F : EQUD &00003F3F
EQUD &FCFCFCFC : EQUD &0000FCFC
.background_mask_2
EQUD &00000000 : EQUD &00000000
EQUD &07030100 : EQUD &7F3F1F0F
EQUD &07030100 : EQUD &7F3F1F0F
EQUD &FFFFFFFF : EQUD &FEFFFFFF

\ *	Screenadress lookup table

.screen             
EQUW &3000 : EQUW &3280 : EQUW &3500 : EQUW &3780
EQUW &3A00 : EQUW &3C80 : EQUW &3F00 : EQUW &4180
EQUW &4400 : EQUW &4680 : EQUW &4900 : EQUW &4B80
EQUW &4E00 : EQUW &5080 : EQUW &5300 : EQUW &5580
EQUW &5800 : EQUW &5A80 : EQUW &5D00 : EQUW &5F80
EQUW &6200 : EQUW &6480 : EQUW &6700 : EQUW &6980
EQUW &6C00 : EQUW &6E80 : EQUW &7100 : EQUW &7380
EQUW &7600 : EQUW &7880 : EQUW &7B00 : EQUW &7D80
.end_data

SAVE "OBJMAIN", start, end
SAVE "OBJDATA", data1, end_data
Igor

Acorn Electron, BBC Master 128, Acorn Archimedes A3000
User avatar
TobyLobster
Posts: 618
Joined: Sat Aug 31, 2019 7:58 am
Contact:

Re: VEXED

Post by TobyLobster »

If you wanted smoother sprite movement, I refined your sprite code. In theory this should just work:

Code: Select all

\ ******************************************************************
\ *	Zero page vars
\ ******************************************************************

ORG &70
GUARD &9F

.spritenum          skip 1
.x                  skip 1
.y                  skip 1
.foreground_colour  skip 1
.background_colour  skip 1
.scrnaddr           skip 2
.scrnaddr_8         skip 2
.spriteaddr         skip 2
.x_count            skip 1
.y_count            skip 1
.t1                 skip 1  ;temp
.t2                 skip 1
.t3                 skip 1
.t4                 skip 1
.down_count         skip 1
.timer_amount       skip 1

\ ******************************************************************
\ *	Code
\ ******************************************************************

ORG &2DA0
GUARD &3000

.start

; Test code:
;
;oswrch = &FFEE
;osfile = &FFDD
;
;LDA #22
;JSR oswrch
;LDA #1
;JSR oswrch
;
;; load data file
;LDX #<osfileblock
;LDY #>osfileblock
;LDA #255
;JSR osfile
;
;LDA #0
;STA spritenum
;LDA #17
;STA x
;LDA #17
;STA y
;LDA #1
;STA foreground_colour
;LDA #2
;STA background_colour
;
;JSR main
;JSR fall_down
;RTS
;
;.osfileblock
;    EQUW filename
;    EQUD 0
;    EQUD 1          ; EXEC address, non-zero meaning load file at file's load address
;    EQUD 0
;    EQUD 0
;.filename
;    EQUS "OBJDATA",13

.main

LDA spritenum       ;setup the sprite address
ASL A
TAX
LDA sprite,X
STA spriteaddr
LDA sprite+1,X
STA spriteaddr+1
JSR calcscraddr     ;calculate the screen address
LDA #19
JSR &FFF4           ;*FX 19 wait for vertical sync
JSR drawsprite
RTS

\ the sprites are coded as 1 bit per pixel.
\ in MODE 1 there are four pixels in every byte
.drawsprite
{
    LDA #2
    STA y_count
.looprow
    LDA #2
    STA x_count
.loopcol
    LDY #7
.loopchar
    LDA (spriteaddr),Y
    LSR A
    LSR A
    LSR A
    LSR A
    JSR get_colour_byte
    STA (scrnaddr),Y        ; draw to screen

    LDA (spriteaddr),Y
    AND #&0F
    JSR get_colour_byte
    STA (scrnaddr_8),Y      ; draw to screen

    DEY
    BPL loopchar
    JSR next_char
    DEC x_count
    BNE loopcol
    JSR next_row
    DEC y_count
    BNE looprow
    RTS
}

; On Entry:
;   A = nybble value (four pixels) to colour
; Preserves Y
.get_colour_byte
    STY t4                  ; preserve Y
    STA t2                  ; remember original nybble
    LDY foreground_colour
    JSR colouring           ; get foreground pixels colour byte
    STA t1                  ; store partial result

    LDA t2                  ; now deal with background colour, recall original nybble
    EOR #&0F                ; invert nybble to set bits of the background pixels
    LDY background_colour
    JSR colouring           ; get background pixel colour byte

    ORA t1                  ; combine background and foreground colour pixels
    LDY t4                  ; restore Y
    RTS

; On Entry:
;   Y = colour (0-3)
;   A = nybble value (four pixels) to colour
; On Exit:
;   A = the colour byte to write to the screen
; Preserves Y
.colouring
{
    TAX
    LDA colour_table,X
    AND colour_mask,Y
    RTS
}

.colour_mask
    EQUB %00000000
    EQUB %00001111
    EQUB %11110000
    EQUB %11111111

.colour_table
    EQUB %00000000
    EQUB %00010001
    EQUB %00100010
    EQUB %00110011
    EQUB %01000100
    EQUB %01010101
    EQUB %01100110
    EQUB %01110111
    EQUB %10001000
    EQUB %10011001
    EQUB %10101010
    EQUB %10111011
    EQUB %11001100
    EQUB %11011101
    EQUB %11101110
    EQUB %11111111

 .calcscraddr
{
    LDX y
    LDA #0
    STA t2
    LDA x
    ASL A
    ROL t2
    ASL A
    ROL t2
    ASL A
    ROL t2
    ADC screen_low,X
    STA scrnaddr
    LDA screen_high,X
    ADC t2
    STA scrnaddr+1

    LDA scrnaddr
    ADC #8
    STA scrnaddr_8
    LDA scrnaddr+1
    ADC #0
    STA scrnaddr_8+1
    RTS
}

 .next_char
{
    CLC
    LDA scrnaddr
    ADC #16
    STA scrnaddr
    BCC skip1
    INC scrnaddr+1
    CLC
.skip1
    LDA scrnaddr_8
    ADC #16
    STA scrnaddr_8
    BCC skip2
    INC scrnaddr_8+1
    CLC
.skip2
    LDA spriteaddr
    ADC #8
    STA spriteaddr
    BCC skip3
    INC spriteaddr+1
.skip3
    RTS
}

 .next_row
{
    LDA scrnaddr
    ADC #&60
    STA scrnaddr
    LDA scrnaddr+1
    ADC #2
    STA scrnaddr+1
    LDA scrnaddr_8
    ADC #&60
    STA scrnaddr_8
    LDA scrnaddr_8+1
    ADC #2
    STA scrnaddr_8+1
    RTS
}

.slide_left
{
    JSR slide_four_pixels_left
.slide_four_pixels_left
    LDA #4
    STA t3
.slide_left_loop
    DEC x
    JSR move_left
    INC x
    LDA #3
    JSR wait
    DEC t3
    BNE slide_left_loop
    DEC x
    RTS
}

.slide_right
{
    JSR slide_four_pixels_right
.slide_four_pixels_right
    LDA #4
    STA t3
.slide_right_loop
    JSR move_right
    LDA #3
    JSR wait
    DEC t3
    BNE slide_right_loop
    INC x
    RTS
}

 .move_left
{
    JSR calcscraddr
    JSR move_row_left

    LDA scrnaddr
    CLC
    ADC #&80
    STA scrnaddr
    LDA scrnaddr+1
    ADC #&2
    STA scrnaddr+1

.move_row_left
    LDA #0
    STA t1

    LDY #32
.move_row_left_loop
    LDA t1
    LSR A
    LSR A
    LSR A
    AND #%00010001
    STA t2
    LDA (scrnaddr),Y
    STA t1
    ASL A
    AND #%11101110
    ORA t2
    STA (scrnaddr),Y
    TYA
    SEC
    SBC #8
    TAY
    BCS move_row_left_loop

    LDX #0
    STX t1
    CLC
    ADC #41
    TAY
    CPY #40
    BNE move_row_left_loop
    RTS
}

.move_right
{
    JSR calcscraddr
    JSR move_row_right
    LDA scrnaddr
    CLC
    ADC #&80
    STA scrnaddr
    LDA scrnaddr+1
    ADC #&2
    STA scrnaddr+1

.move_row_right
    LDA #0
    STA t1

    LDY #0
.move_row_right_loop
    LDA t1
    ASL A
    ASL A
    ASL A
    AND #%10001000
    STA t2
    LDA (scrnaddr),Y
    STA t1
    LSR A
    AND #%01110111
    ORA t2
    STA (scrnaddr),Y
    TYA
    CLC
    ADC #8
    TAY
    CPY #40
    BCC move_row_right_loop

    LDX #0
    STX t1
    SEC
    SBC #39
    TAY
    CPY #8
    BNE move_row_right_loop
    RTS
}

.fall_down
{
    JSR move_down
.move_down
    LDA #8
    STA down_count
.move_down_loop
    JSR move_down_once
    LDA #2
    JSR wait
    DEC down_count
    BNE move_down_loop
    INC y
    RTS
}

.move_down_once
{
    LDA #4
    STA x_count

.move_down_x_loop
    LDA #3
    STA y_count

    LDA #0
    STA t1
.move_down_y_loop
    LDA t1
    JSR move_one_cell_down
    INC y
    DEC y_count
    BNE move_down_y_loop
    DEC y
    DEC y
    DEC y
    INC x
    DEC x_count
    BNE move_down_x_loop
    DEC x
    DEC x
    DEC x
    DEC x
    RTS

.move_one_cell_down
    STA t3
    JSR calcscraddr
    LDY #7
    LDA (scrnaddr),Y
    STA t1
    DEY
.move_down_loop
    LDA (scrnaddr),Y
    INY
    STA (scrnaddr),Y
    DEY
    DEY
    BPL move_down_loop
    INY
    LDA t3
    STA (scrnaddr),Y
    RTS
}

.wait
{
    STA timer_amount
    JSR set_timer
    JMP check_timer
}

.set_timer                      ;set 20 millisecond timer
{
    LDA #1
    LDX #timer1 MOD 256
    LDY #timer1 DIV 256
    JSR &FFF1
    CLC
    LDA timer1
    ADC timer_amount
    STA timer1
    BCC skip4
    INC timer1+1
.skip4
    RTS
}
.check_timer                    ;wait until set time has passed
{
    LDA #1
    LDX #timer2 MOD 256
    LDY #timer2 DIV 256
    JSR &FFF1
    SEC
    LDA timer1
    SBC timer2
    LDA timer1+1
    SBC timer2+1
    BCS check_timer             ;Carry is cleared on a negative result
    RTS
}
.timer1         skip 5
.timer2         skip 5
.end
\ ******************************************************************
\ *	Data
\ ******************************************************************
ORG &900

\ *	Spritedata 1 bit per pixel
.data1
EQUD &EAD5FF7F : EQUD &EAD5EAD5
EQUD &AB57FFFE : EQUD &AB57AB57
EQUD &EAD5EAD5 : EQUD &7FFFEAD5
EQUD &AB57AB57 : EQUD &FEFFAB57
.data2
EQUD &C1C0FF7F : EQUD &DFCFC7C3
EQUD &8383FFFE : EQUD &FBF38383
EQUD &C1C1CFDF : EQUD &7FFFC1C1
EQUD &C3E3F3FB : EQUD &FEFF0383
.data3
EQUD &C3C3FF7F : EQUD &FCFCC3C3
EQUD &C3C3FFFE : EQUD &3F3FC3C3
EQUD &C3C3FCFC : EQUD &7FFFC3C3
EQUD &C3C33F3F : EQUD &FEFFC3C3
.data4
EQUD &C3C0FF7F : EQUD &D8D8CCC7
EQUD &C303FFFE : EQUD &1B1B33E3
EQUD &C7CCD8D8 : EQUD &7FFFC0C3
EQUD &E3331B1B : EQUD &FEFF03C3
.data5
EQUD &D8C0FF7F : EQUD &C0C0C0D8
EQUD &1B03FFFE : EQUD &0303031B
EQUD &D8C0C0C0 : EQUD &7FFFC0D8
EQUD &1B030303 : EQUD &FEFF031B
.data6
EQUD &CFC0FF7F : EQUD &C6CCD8DF
EQUD &F303FFFE : EQUD &63331BFB
EQUD &C1C1C1C3 : EQUD &7FFFC0C1
EQUD &838383C3 : EQUD &FEFF0383
.data7
EQUD &D8C0FF7F : EQUD &C3C7CEDC
EQUD &1B03FFFE : EQUD &C3E3733B
EQUD &DCCEC7C3 : EQUD &7FFFC0D8
EQUD &3B73E3C3 : EQUD &FEFF031B
.data8
EQUD &C0C0FF7F : EQUD &CCCCCFCF
EQUD &0303FFFE : EQUD &3333F3F3
EQUD &CFCFCCCC : EQUD &7FFFC0C0
EQUD &F3F33333 : EQUD &FEFF0303
.data9
EQUD &C0C0FF7F : EQUD &CFC7C7C1
EQUD &0303FFFE : EQUD &F3E3E383
EQUD &C1C7C7CF : EQUD &7FFFC0C0
EQUD &83E3E3F3 : EQUD &FEFF0303
.data10
EQUD &C0C0FF7F : EQUD &C0C0C0C0
EQUD &0303FFFE : EQUD &03030303
EQUD &C0C0C0C0 : EQUD &7FFFC0C0
EQUD &03030303 : EQUD &FEFF0303
.sprite
EQUW data1
EQUW data2
EQUW data3
EQUW data4
EQUW data5
EQUW data6
EQUW data7
EQUW data8
EQUW data9
EQUW data10
.background_mask_1
EQUD &3F3F0000 : EQUD &3F3F3F3F
EQUD &FCFC0000 : EQUD &FCFCFCFC
EQUD &3F3F3F3F : EQUD &00003F3F
EQUD &FCFCFCFC : EQUD &0000FCFC
.background_mask_2
EQUD &00000000 : EQUD &00000000
EQUD &07030100 : EQUD &7F3F1F0F
EQUD &07030100 : EQUD &7F3F1F0F
EQUD &FFFFFFFF : EQUD &FEFFFFFF

\ *	Screen address lookup table

.screen_low
FOR n, 0, 31
  EQUB LO(&3000 + n * &280)
NEXT
.screen_high
FOR n, 0, 31
  EQUB HI(&3000 + n * &280)
NEXT

.end_data

SAVE "OBJMAIN", start, end
SAVE "OBJDATA", data1, end_data
User avatar
Iggypop
Posts: 192
Joined: Thu Mar 05, 2020 6:34 pm
Location: The Netherlands
Contact:

Re: VEXED

Post by Iggypop »

looking at it.....
The use of this colour table is genius!!
saved some cpu cycles in next_char, creative !
the background colour completely fills the sprite.. my routine only partially fills the backgroundcolour....

i like the remarks with every subroutine
ON ENTRY
ON EXIT
PRESERVES

good practise

thank you very much for your contributions they are very, very helpfull and educational !!!!!!!!!!!!!!!!!!!!!
Last edited by Iggypop on Thu Nov 17, 2022 4:28 pm, edited 5 times in total.
Igor

Acorn Electron, BBC Master 128, Acorn Archimedes A3000
User avatar
TobyLobster
Posts: 618
Joined: Sat Aug 31, 2019 7:58 am
Contact:

Re: VEXED

Post by TobyLobster »

Thanks! Small fix: I just noticed .next_row should have a CLC at the start.
User avatar
Iggypop
Posts: 192
Joined: Thu Mar 05, 2020 6:34 pm
Location: The Netherlands
Contact:

Re: VEXED

Post by Iggypop »

i'm in the process of combining / merging the code.. working on it.. i love the smooth animation !!! :D
Igor

Acorn Electron, BBC Master 128, Acorn Archimedes A3000
User avatar
Iggypop
Posts: 192
Joined: Thu Mar 05, 2020 6:34 pm
Location: The Netherlands
Contact:

Sprite routine assembly code

Post by Iggypop »

Code: Select all

\ ******************************************************************
\ *	Zero page vars
\ ******************************************************************

ORG &70
GUARD &9F

.spritenum          skip 1
.x                  skip 1
.y                  skip 1
.foreground_colour  skip 1
.background_colour  skip 1
.scrnaddr           skip 2
.scrnaddr_8         skip 2
.spriteaddr         skip 2
.x_count            skip 1
.y_count            skip 1
.t1                 skip 1  ;temp
.t2                 skip 1
.t3                 skip 1
.t4                 skip 1
.t5		    skip 1
.t6		    skip 1
.down_count         skip 1
.timer_amount       skip 1
.high_nibble        skip 1
.low_nibble         skip 1
.colour             skip 1

\ ******************************************************************
\ *	Code
\ ******************************************************************

ORG &2D50
GUARD &3000

.start

.main

LDA spritenum       ;setup the sprite address
ASL A
TAX			;spritenum * 2
LDA sprite,X		;load sprite adress
STA spriteaddr
LDA sprite+1,X
STA spriteaddr+1
JSR calcscraddr     ;calculate the screen address
LDA #19
JSR &FFF4           ;*FX 19 wait for vertical sync
JSR drawsprite
RTS

\ the sprites are coded as 1 bit per pixel.
\ in MODE 1 there are four pixels in every byte
.drawsprite
{
    LDX #0
    LDA #2
    STA y_count
.looprow
    LDA #2
    STA x_count
.loopcol
    LDY #0
.loopchar
    LDA foreground_colour
    STA colour
    CMP #0
    BEQ colour_0
    LDA (spriteaddr),Y	    
    STA t1                  ;save 1bit coded sprite byte in t1 
    LSR A                   ;process high_nibble (first 4 bits)
    LSR A
    LSR A
    LSR A
    JSR get_colour_byte
    STA high_nibble
    LDA t1       	        
    AND #&0F                ;process low nibble (last 4 bits)
    JSR get_colour_byte
    STA low_nibble
    LDA background_colour   ;if background colour is not zero add second coloured sprite (sprite_mask)
    STA colour
    CMP #0
    BEQ draw
    LDA high_nibble         ;save the high_nibble in t4
    STA t4
    LDA low_nibble
    STA t3                  ;save the low_nibble in t3
    LDA t1                  ;get the original 1 bit encoded sprite byte
    EOR #&FF                ;perform NOT
    AND background_mask_2,X 
    STA t2                  ;store intermediate result in t2
    LSR A                   ;process high_nibble
    LSR A
    LSR A
    LSR A
    JSR get_colour_byte
    ORA t4                  
    STA high_nibble
    LDA t2       	        ;restore the AND operation
    AND #&0F                ;process low_nibble
    JSR get_colour_byte
    ORA t3
    STA low_nibble
    JMP draw
    .colour_0
    LDA #0
    STA high_nibble
    STA low_nibble      
    .draw
    LDA high_nibble
    STA (scrnaddr),Y 
    LDA low_nibble
    STA (scrnaddr_8),Y  
    INX      
    INY
    CPY #8
    BNE loopchar
    JSR next_char
    DEC x_count
    BNE loopcol
    JSR next_row
    DEC y_count
    BNE looprow
    RTS
}

; ON ENTRY A = nibble value (four pixels) to colour, colour
; PRESERVES Y, X
; ON EXIT A holds the coloured bits

.get_colour_byte
{
    STY t5                  ; preserve Y
    STX t6
    LDY colour
    TAX
    LDA colour_table,X
    AND colour_mask,Y    
    LDY t5                  ; restore Y
    LDX t6
    RTS
}


.colour_mask
    EQUB %00000000
    EQUB %00001111
    EQUB %11110000
    EQUB %11111111

.colour_table
    EQUB %00000000
    EQUB %00010001
    EQUB %00100010
    EQUB %00110011
    EQUB %01000100
    EQUB %01010101
    EQUB %01100110
    EQUB %01110111
    EQUB %10001000
    EQUB %10011001
    EQUB %10101010
    EQUB %10111011
    EQUB %11001100
    EQUB %11011101
    EQUB %11101110
    EQUB %11111111

 .calcscraddr
{
    LDX y
    LDA #0
    STA t2
    LDA x
    ASL A
    ROL t2
    ASL A
    ROL t2
    ASL A
    ROL t2
    ADC screen_low,X
    STA scrnaddr
    LDA screen_high,X
    ADC t2
    STA scrnaddr+1
    LDA scrnaddr
    ADC #8
    STA scrnaddr_8
    LDA scrnaddr+1
    ADC #0
    STA scrnaddr_8+1
    RTS
}

 .next_char
{
    CLC
    LDA scrnaddr
    ADC #16
    STA scrnaddr
    BCC skip1
    INC scrnaddr+1
    CLC
.skip1
    LDA scrnaddr_8
    ADC #16
    STA scrnaddr_8
    BCC skip2
    INC scrnaddr_8+1
    CLC
.skip2
    LDA spriteaddr
    ADC #8
    STA spriteaddr
    BCC skip3
    INC spriteaddr+1
.skip3
    RTS
}

 .next_row
{
    CLC
    LDA scrnaddr
    ADC #&60
    STA scrnaddr
    LDA scrnaddr+1
    ADC #2
    STA scrnaddr+1
    LDA scrnaddr_8
    ADC #&60
    STA scrnaddr_8
    LDA scrnaddr_8+1
    ADC #2
    STA scrnaddr_8+1
    RTS
}

.slide_left
{
    JSR slide_four_pixels_left
    JSR slide_four_pixels_left
    JSR slide_four_pixels_left
    JSR slide_four_pixels_left
    RTS
.slide_four_pixels_left
    LDA #4
    STA t3
.slide_left_loop
    DEC x
    JSR move_left
    INC x
    LDA #3
    JSR wait
    DEC t3
    BNE slide_left_loop
    DEC x
    RTS
}

.slide_right
{
    JSR slide_four_pixels_right
    JSR slide_four_pixels_right
    JSR slide_four_pixels_right
    JSR slide_four_pixels_right
    RTS
.slide_four_pixels_right
    LDA #4
    STA t3
.slide_right_loop
    JSR move_right
    LDA #3
    JSR wait
    DEC t3
    BNE slide_right_loop
    INC x
    RTS
}

 .move_left
{
    JSR calcscraddr
    JSR move_row_left

    LDA scrnaddr
    CLC
    ADC #&80
    STA scrnaddr
    LDA scrnaddr+1
    ADC #&2
    STA scrnaddr+1

.move_row_left
    LDA #0
    STA t1

    LDY #32
.move_row_left_loop
    LDA t1
    LSR A
    LSR A
    LSR A
    AND #%00010001
    STA t2
    LDA (scrnaddr),Y
    STA t1
    ASL A
    AND #%11101110
    ORA t2
    STA (scrnaddr),Y
    TYA
    SEC
    SBC #8
    TAY
    BCS move_row_left_loop

    LDX #0
    STX t1
    CLC
    ADC #41
    TAY
    CPY #40
    BNE move_row_left_loop
    RTS
}

.move_right
{
    JSR calcscraddr
    JSR move_row_right
    LDA scrnaddr
    CLC
    ADC #&80
    STA scrnaddr
    LDA scrnaddr+1
    ADC #&2
    STA scrnaddr+1

.move_row_right
    LDA #0
    STA t1

    LDY #0
.move_row_right_loop
    LDA t1
    ASL A
    ASL A
    ASL A
    AND #%10001000
    STA t2
    LDA (scrnaddr),Y
    STA t1
    LSR A
    AND #%01110111
    ORA t2
    STA (scrnaddr),Y
    TYA
    CLC
    ADC #8
    TAY
    CPY #40
    BCC move_row_right_loop

    LDX #0
    STX t1
    SEC
    SBC #39
    TAY
    CPY #8
    BNE move_row_right_loop
    RTS
}

.fall_down
{
    JSR move_down
    JSR move_down
    RTS
.move_down
    LDA #8
    STA down_count
.move_down_loop
    JSR move_down_once
    LDA #2
    JSR wait
    DEC down_count
    BNE move_down_loop
    INC y
    RTS
}

.move_down_once
{
    LDA #4
    STA x_count

.move_down_x_loop
    LDA #3
    STA y_count

    LDA #0
    STA t1
.move_down_y_loop
    LDA t1
    JSR move_one_cell_down
    INC y
    DEC y_count
    BNE move_down_y_loop
    DEC y
    DEC y
    DEC y
    INC x
    DEC x_count
    BNE move_down_x_loop
    DEC x
    DEC x
    DEC x
    DEC x
    RTS

.move_one_cell_down
    STA t3
    JSR calcscraddr
    LDY #7
    LDA (scrnaddr),Y
    STA t1
    DEY
.move_down_loop
    LDA (scrnaddr),Y
    INY
    STA (scrnaddr),Y
    DEY
    DEY
    BPL move_down_loop
    INY
    LDA t3
    STA (scrnaddr),Y
    RTS
}

.wait
{
    STA timer_amount
    JSR set_timer
    JMP check_timer
}

.set_timer                      ;set 20 millisecond timer
{
    LDA #1
    LDX #timer1 MOD 256
    LDY #timer1 DIV 256
    JSR &FFF1
    CLC
    LDA timer1
    ADC timer_amount
    STA timer1
    BCC skip4
    INC timer1+1
.skip4
    RTS
}
.check_timer                    ;wait until set time has passed
{
    LDA #1
    LDX #timer2 MOD 256
    LDY #timer2 DIV 256
    JSR &FFF1
    SEC
    LDA timer1
    SBC timer2
    LDA timer1+1
    SBC timer2+1
    BCS check_timer             ;Carry is cleared on a negative result
    RTS
}
.timer1         skip 5
.timer2         skip 5
.end
\ ******************************************************************
\ *	Data
\ ******************************************************************
ORG &900

\ *	Spritedata 1 bit per pixel
.data1
EQUD &EAD5FF7F : EQUD &EAD5EAD5
EQUD &AB57FFFE : EQUD &AB57AB57
EQUD &EAD5EAD5 : EQUD &7FFFEAD5
EQUD &AB57AB57 : EQUD &FEFFAB57
.data2
EQUD &C1C0FF7F : EQUD &DFCFC7C3
EQUD &8383FFFE : EQUD &FBF38383
EQUD &C1C1CFDF : EQUD &7FFFC1C1
EQUD &C3E3F3FB : EQUD &FEFF0383
.data3
EQUD &C3C3FF7F : EQUD &FCFCC3C3
EQUD &C3C3FFFE : EQUD &3F3FC3C3
EQUD &C3C3FCFC : EQUD &7FFFC3C3
EQUD &C3C33F3F : EQUD &FEFFC3C3
.data4
EQUD &C3C0FF7F : EQUD &D8D8CCC7
EQUD &C303FFFE : EQUD &1B1B33E3
EQUD &C7CCD8D8 : EQUD &7FFFC0C3
EQUD &E3331B1B : EQUD &FEFF03C3
.data5
EQUD &D8C0FF7F : EQUD &C0C0C0D8
EQUD &1B03FFFE : EQUD &0303031B
EQUD &D8C0C0C0 : EQUD &7FFFC0D8
EQUD &1B030303 : EQUD &FEFF031B
.data6
EQUD &CFC0FF7F : EQUD &C6CCD8DF
EQUD &F303FFFE : EQUD &63331BFB
EQUD &C1C1C1C3 : EQUD &7FFFC0C1
EQUD &838383C3 : EQUD &FEFF0383
.data7
EQUD &D8C0FF7F : EQUD &C3C7CEDC
EQUD &1B03FFFE : EQUD &C3E3733B
EQUD &DCCEC7C3 : EQUD &7FFFC0D8
EQUD &3B73E3C3 : EQUD &FEFF031B
.data8
EQUD &C0C0FF7F : EQUD &CCCCCFCF
EQUD &0303FFFE : EQUD &3333F3F3
EQUD &CFCFCCCC : EQUD &7FFFC0C0
EQUD &F3F33333 : EQUD &FEFF0303
.data9
EQUD &C0C0FF7F : EQUD &CFC7C7C1
EQUD &0303FFFE : EQUD &F3E3E383
EQUD &C1C7C7CF : EQUD &7FFFC0C0
EQUD &83E3E3F3 : EQUD &FEFF0303
.data10
EQUD &C0C0FF7F : EQUD &C0C0C0C0
EQUD &0303FFFE : EQUD &03030303
EQUD &C0C0C0C0 : EQUD &7FFFC0C0
EQUD &03030303 : EQUD &FEFF0303
.sprite
EQUW data1
EQUW data2
EQUW data3
EQUW data4
EQUW data5
EQUW data6
EQUW data7
EQUW data8
EQUW data9
EQUW data10
.background_mask_1
EQUD &3F3F0000 : EQUD &3F3F3F3F
EQUD &FCFC0000 : EQUD &FCFCFCFC
EQUD &3F3F3F3F : EQUD &00003F3F
EQUD &FCFCFCFC : EQUD &0000FCFC
.background_mask_2
EQUD &00000000 : EQUD &00000000
EQUD &07030100 : EQUD &7F3F1F0F
EQUD &07030100 : EQUD &7F3F1F0F
EQUD &FFFFFFFF : EQUD &FEFFFFFF

\ *	Screen address lookup table

.screen_low
FOR n, 0, 31
  EQUB LO(&3000 + n * &280)
NEXT
.screen_high
FOR n, 0, 31
  EQUB HI(&3000 + n * &280)
NEXT

.end_data

PUTBASIC "TEST.BAS","TEST"
SAVE "OBJMAIN", start, end
SAVE "OBJDATA", data1, end_data
Last edited by Iggypop on Mon Nov 21, 2022 3:22 pm, edited 3 times in total.
Igor

Acorn Electron, BBC Master 128, Acorn Archimedes A3000
User avatar
Iggypop
Posts: 192
Joined: Thu Mar 05, 2020 6:34 pm
Location: The Netherlands
Contact:

NEW VERSION

Post by Iggypop »

New Version Available, comes with smooth sprite animations thanks to TobyLobster

download new version above
Igor

Acorn Electron, BBC Master 128, Acorn Archimedes A3000
User avatar
Iggypop
Posts: 192
Joined: Thu Mar 05, 2020 6:34 pm
Location: The Netherlands
Contact:

Re: VEXED

Post by Iggypop »

I can confirm that the game works on a Acorn Electron with an MMFS filing system.. that comes in/with an ELKSD64 or 128 expansion cartridge.
Igor

Acorn Electron, BBC Master 128, Acorn Archimedes A3000
User avatar
Iggypop
Posts: 192
Joined: Thu Mar 05, 2020 6:34 pm
Location: The Netherlands
Contact:

Re: VEXED

Post by Iggypop »

New version of VeXeD comes with two new level packs, that's 120 extra puzzels, plus some in game quality of life enhancements.

One bug fix : cursor didn't corretly highlight selected block.

Get the latest update at the beginning of this thread !!
Igor

Acorn Electron, BBC Master 128, Acorn Archimedes A3000
Post Reply

Return to “miscellaneous new bbc and electron games”