News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_EgoTrip

Help me make Subtera Puzlo for CPC please

Started by EgoTrip, 13:33, 17 November 12

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

EgoTrip

In case you are not aware, I created a game for the NDS here: NDS Homebrew Game by me


I want to make a CPC version. I have nearly everything ready, I have converted the graphics to CPC Mode 1, I have the music.


I could create a simple menu screen myself in assembly, thats not too difficult. I would need help with redifine keys routine. Also I would want a raster split on the title screen for more colours.


What I really would need help with is the main engine, and sprite routine. This should not be too difficult for people who know what they are doing, the way the main character moves is in a 16x16 grid, 2 pixels at a time and stops when aligned unless the appropriate direction key is held.


The screen size of the NDS is 256x192 (spectrum size) but as this only leaves 8 pixels at the bottom. Many of the levels on the DS game have a border around them and are in effect using 224x148. There would need to be somewhere on the screen to display score, would it be possible using the smaller size to have a raster split and keep uniform colours, while the palette changes for each level?


Also a way to generate levels and have the player interact with them, ie stopping at walls, only going through the correct direction on the directional floors, unable to stop on ice, dying when the trap floors activate, collision with enemies, etc.


Also, enemy movement is another thing. How many enemies would be acceptable before any slow down? There are also tiles that need animating, such as the force fields, trap floors, exit, and one of the enemies.


I have tried the various examples around the place but just get confused by them. I feel it would probably be better for me, and for others also wanting to learn, if the game, and specific routines, were created on here from scratch.

Gryzor

Two weeks, no replies? For crying shame, guys :)


Bryce

I think most people replied in the thread he links to.

Bryce.

Gryzor

Ahhh ok. Apologies, haven't reached that thread yet.

db6128

#4
FWIW:
Quote from: EgoTrip on 13:33, 17 November 12The screen size of the NDS is 256x192 (spectrum size) but as this only leaves 8 pixels at the bottom. Many of the levels on the DS game have a border around them and are in effect using 224x148. There would need to be somewhere on the screen to display score
In fact, the default screen size of 200 scanlines at 80 bytes (in MODE 1: 320 pixels, 40×25 characters) each leaves some of the 16 kB of screen memory unused. And exactly that much memory is needed for a 256×256 px (32×32 characters) display :) So you should definitely have plenty of space for a HUD, especially if you leave the screen at the smaller size that you used on the DS.

Here is the code that I myself am currently using to set up that size of screen:
; screen size
ld b,&BC ; select register
ld hl,CRTC_TBL ; table for 32x32
ld a,(hl) ; counter of pairs
inc hl
CRTC_SET:
ld c,(hl)
inc hl
out (c),c ; Select register
inc b   ; INC to &BD00
ld c,(hl)
inc hl
out (c),c ; Set register
dec b   ; DEC to &BC00
dec a   ; Are there any more pairs?
jr nz,CRTC_SET

[...]

CRTC_TBL:
db 4 ; 4 pairs of data
db 1,32 ; columns
db 2,42 ; horizontal sync pulse location
db 6,32 ; rows
db 7,34 ; vertical sync pulse location



Quotewould it be possible using the smaller size to have a raster split and keep uniform colours, while the palette changes for each level?
I know this should definitely be possible, but unfortunately, as with you, it's currently beyond my capabilities!  ::)  All I know is that you get 6 interrupts that are precise in both timing and vertical location per frame, which can be used to redefine INKs or/and MODEs reliably on every refresh. So, it should be fairly simple, and there'll definitely be many people here who can advise you on how to do it.

Edit to add:
QuoteWhat I really would need help with is the main engine, and sprite routine.
Engines are also beyond my current skills, but I'd be happy to try to write a fairly optimised sprite-plotting routine if you want me to give it a try. It would be best if you let me know what you need: do you have tiles of a defined size or any especially common sizes? do you need transparency? how much memory could I have for fast look-up tables for masking and shifting? and so on.
Of course, many of the more experienced programmers here will already have excellent routines ready to go, so feel free just to use one of theirs ;) But this could be a fun and educational little exercise for me if you're able to wait a small amount of time for the result. :)
Quote from: Devilmarkus on 13:04, 27 February 12
Quote from: ukmarkh on 11:38, 27 February 12[The owner of one of the few existing cartridges of Chase HQ 2] mentioned to me that unless someone could find a way to guarantee the code wouldn't be duplicated to anyone else, he wouldn't be interested.
Did he also say things like "My treasureeeeee" and is he a little grey guy?

EgoTrip

Thanks for the reply. I really dont have much of a clue when it comes to the CPC. I have got a bare bones BASIC engine running, using the sprite routine from Sean McManus, but its not good enough. Besides I am struggling to implement most things. If SP is going to exist on the CPC, I want it to be as good as possible.


The tiles will need transparency. Here is the tilesheet:






EgoTrip

#6
Heres the first 20 sprites in defb format





.Brick1
defb &FF,&FF,&FF,&FF; line 0
defb &F8,&F0,&F0,&B7; line 1
defb &DB,&2F,&4F,&BF; line 2
defb &EB,&0F,&0F,&7F; line 3
defb &CB,&0F,&0F,&3F; line 4
defb &CB,&0F,&0F,&3F; line 5
defb &EB,&0F,&0F,&7F; line 6
defb &CB,&0F,&0F,&3F; line 7
defb &CB,&0F,&0F,&3F; line 8
defb &EB,&0F,&0F,&7F; line 9
defb &CB,&0F,&0F,&3F; line 10
defb &CB,&0F,&0F,&3F; line 11
defb &EB,&0F,&0F,&7F; line 12
defb &DB,&2F,&4F,&BF; line 13
defb &BF,&FF,&FF,&FF; line 14
defb &FF,&FF,&FF,&FF; line 15




.DirU
defb &FF,&FF,&FF,&FF; line 0
defb &CF,&0F,&0F,&3D; line 1
defb &9F,&FE,&F7,&FD; line 2
defb &BF,&FD,&FB,&FD; line 3
defb &BF,&FD,&FB,&FD; line 4
defb &BF,&FB,&FD,&FD; line 5
defb &BF,&EB,&7D,&FD; line 6
defb &BF,&E7,&7E,&FD; line 7
defb &BF,&C7,&3E,&FD; line 8
defb &BE,&CF,&3F,&F5; line 9
defb &BE,&CF,&3F,&F5; line 10
defb &BD,&8F,&1F,&F9; line 11
defb &BC,&F0,&F0,&F1; line 12
defb &BF,&FF,&FF,&F9; line 13
defb &F8,&F0,&F0,&F3; line 14
defb &FF,&FF,&FF,&FF; line 15




.DirL
defb &FF,&FF,&FF,&FF; line 0
defb &CF,&0F,&0F,&3D; line 1
defb &9F,&FF,&FE,&F5; line 2
defb &BF,&FF,&F9,&F5; line 3
defb &BF,&FE,&F7,&F5; line 4
defb &BF,&F9,&DF,&F5; line 5
defb &BE,&F7,&1F,&F5; line 6
defb &BD,&CF,&1F,&F5; line 7
defb &BD,&CF,&1F,&F5; line 8
defb &BE,&F7,&1F,&F5; line 9
defb &BF,&F9,&DF,&F5; line 10
defb &BF,&FE,&F7,&F5; line 11
defb &BF,&FF,&F9,&F5; line 12
defb &BF,&FF,&FE,&F1; line 13
defb &F8,&F0,&F0,&F3; line 14
defb &FF,&FF,&FF,&FF; line 15




.DirR
defb &FF,&FF,&FF,&FF; line 0
defb &8F,&0F,&0F,&3D; line 1
defb &9E,&F7,&FF,&FD; line 2
defb &BE,&F9,&FF,&FD; line 3
defb &BE,&FE,&F7,&FD; line 4
defb &BE,&7F,&F9,&FD; line 5
defb &BE,&1F,&FE,&F5; line 6
defb &BE,&0F,&7F,&F9; line 7
defb &BE,&0F,&7F,&F9; line 8
defb &BE,&1F,&FE,&F5; line 9
defb &BE,&7F,&F9,&FD; line 10
defb &BE,&FE,&F7,&FD; line 11
defb &BE,&F9,&FF,&FD; line 12
defb &BE,&F7,&FF,&F9; line 13
defb &F8,&F0,&F0,&F3; line 14
defb &FF,&FF,&FF,&FF; line 15




.DirD
defb &FF,&FF,&FF,&FF; line 0
defb &8F,&0F,&0F,&3D; line 1
defb &9F,&FF,&FF,&FD; line 2
defb &BC,&F0,&F0,&F1; line 3
defb &BD,&8F,&1F,&F9; line 4
defb &BE,&CF,&3F,&F5; line 5
defb &BE,&CF,&3F,&F5; line 6
defb &BF,&E7,&7E,&FD; line 7
defb &BF,&E7,&7E,&FD; line 8
defb &BF,&FB,&FD,&FD; line 9
defb &BF,&FB,&FD,&FD; line 10
defb &BF,&FD,&FB,&FD; line 11
defb &BF,&FD,&FB,&FD; line 12
defb &BF,&FE,&F7,&F9; line 13
defb &F8,&F0,&F0,&F1; line 14
defb &FF,&FF,&FF,&FF; line 15




.Exit1
defb &FF,&FF,&FF,&FF; line 0
defb &8F,&0F,&0F,&1F; line 1
defb &BC,&F0,&F0,&D3; line 2
defb &AD,&0F,&0F,&5B; line 3
defb &AD,&F0,&F0,&5B; line 4
defb &AD,&87,&1E,&5B; line 5
defb &AD,&B4,&D2,&5B; line 6
defb &AD,&B5,&DA,&5B; line 7
defb &AD,&B5,&DA,&5B; line 8
defb &AD,&B4,&D2,&5B; line 9
defb &AD,&87,&1E,&5B; line 10
defb &AD,&F0,&F0,&5B; line 11
defb &AD,&0F,&0F,&5B; line 12
defb &BC,&F0,&F0,&D3; line 13
defb &8F,&0F,&0F,&1F; line 14
defb &FF,&FF,&FF,&FF; line 15




.Exit2
defb &FF,&FF,&FF,&FF; line 0
defb &F8,&F0,&F0,&F1; line 1
defb &CB,&0F,&0F,&3D; line 2
defb &DA,&F0,&F0,&B5; line 3
defb &DA,&0F,&0F,&B5; line 4
defb &DA,&78,&E1,&B5; line 5
defb &DA,&4B,&2D,&B5; line 6
defb &DA,&5B,&AD,&B5; line 7
defb &DA,&5B,&AD,&B5; line 8
defb &DA,&4B,&2D,&B5; line 9
defb &DA,&78,&E1,&B5; line 10
defb &DA,&0F,&0F,&B5; line 11
defb &DA,&F0,&F0,&B5; line 12
defb &CB,&0F,&0F,&3D; line 13
defb &F8,&F0,&F0,&F1; line 14
defb &FF,&FF,&FF,&FF; line 15




.ForceV1
defb &00,&00,&00,&00; line 0
defb &00,&00,&00,&00; line 1
defb &00,&00,&00,&00; line 2
defb &00,&00,&00,&00; line 3
defb &FF,&FF,&FF,&FF; line 4
defb &0F,&0F,&0F,&0F; line 5
defb &F0,&F0,&F0,&F0; line 6
defb &0F,&0F,&0F,&0F; line 7
defb &0F,&0F,&0F,&0F; line 8
defb &F0,&F0,&F0,&F0; line 9
defb &0F,&0F,&0F,&0F; line 10
defb &FF,&FF,&FF,&FF; line 11
defb &00,&00,&00,&00; line 12
defb &00,&00,&00,&00; line 13
defb &00,&00,&00,&00; line 14
defb &00,&00,&00,&00; line 15




.ForceV2
defb &00,&00,&00,&00; line 0
defb &00,&00,&00,&00; line 1
defb &00,&00,&00,&00; line 2
defb &00,&00,&00,&00; line 3
defb &FF,&FF,&FF,&FF; line 4
defb &F0,&F0,&F0,&F0; line 5
defb &0F,&0F,&0F,&0F; line 6
defb &F0,&F0,&F0,&F0; line 7
defb &F0,&F0,&F0,&F0; line 8
defb &0F,&0F,&0F,&0F; line 9
defb &F0,&F0,&F0,&F0; line 10
defb &FF,&FF,&FF,&FF; line 11
defb &00,&00,&00,&00; line 12
defb &00,&00,&00,&00; line 13
defb &00,&00,&00,&00; line 14
defb &00,&00,&00,&00; line 15




.ForceH1
defb &00,&AD,&5B,&00; line 0
defb &00,&AD,&5B,&00; line 1
defb &00,&AD,&5B,&00; line 2
defb &00,&AD,&5B,&00; line 3
defb &00,&AD,&5B,&00; line 4
defb &00,&AD,&5B,&00; line 5
defb &00,&AD,&5B,&00; line 6
defb &00,&AD,&5B,&00; line 7
defb &00,&AD,&5B,&00; line 8
defb &00,&AD,&5B,&00; line 9
defb &00,&AD,&5B,&00; line 10
defb &00,&AD,&5B,&00; line 11
defb &00,&AD,&5B,&00; line 12
defb &00,&AD,&5B,&00; line 13
defb &00,&AD,&5B,&00; line 14
defb &00,&AD,&5B,&00; line 15




.ForceH2
defb &00,&DA,&B5,&00; line 0
defb &00,&DA,&B5,&00; line 1
defb &00,&DA,&B5,&00; line 2
defb &00,&DA,&B5,&00; line 3
defb &00,&DA,&B5,&00; line 4
defb &00,&DA,&B5,&00; line 5
defb &00,&DA,&B5,&00; line 6
defb &00,&DA,&B5,&00; line 7
defb &00,&DA,&B5,&00; line 8
defb &00,&DA,&B5,&00; line 9
defb &00,&DA,&B5,&00; line 10
defb &00,&DA,&B5,&00; line 11
defb &00,&DA,&B5,&00; line 12
defb &00,&DA,&B5,&00; line 13
defb &00,&DA,&B5,&00; line 14
defb &00,&DA,&B5,&00; line 15




.Key1
defb &00,&00,&00,&00; line 0
defb &33,&EE,&00,&00; line 1
defb &47,&1F,&00,&00; line 2
defb &8F,&E1,&88,&00; line 3
defb &8F,&AD,&88,&00; line 4
defb &BD,&ED,&88,&00; line 5
defb &AD,&8F,&88,&00; line 6
defb &9E,&96,&4C,&00; line 7
defb &47,&0F,&A6,&00; line 8
defb &33,&EF,&5B,&00; line 9
defb &00,&11,&2D,&88; line 10
defb &00,&00,&9E,&4C; line 11
defb &00,&11,&C3,&A6; line 12
defb &00,&23,&69,&5B; line 13
defb &00,&11,&5B,&BD; line 14
defb &00,&00,&AE,&FF; line 15




.Lock1
defb &FF,&FF,&FF,&FF; line 0
defb &FC,&F0,&F0,&F3; line 1
defb &CB,&1F,&8F,&3D; line 2
defb &CB,&3F,&CF,&3D; line 3
defb &CB,&7F,&EF,&3D; line 4
defb &CB,&7F,&EF,&3D; line 5
defb &CB,&3F,&CF,&3D; line 6
defb &CB,&1F,&8F,&3D; line 7
defb &CB,&1F,&8F,&3D; line 8
defb &CB,&3F,&CF,&3D; line 9
defb &CB,&3F,&CF,&3D; line 10
defb &CB,&3F,&CF,&3D; line 11
defb &CB,&3F,&CF,&3D; line 12
defb &CB,&1F,&8F,&3D; line 13
defb &FC,&F0,&F0,&F3; line 14
defb &FF,&FF,&FF,&FF; line 15




.Timer1
defb &00,&00,&00,&00; line 0
defb &33,&FF,&FF,&88; line 1
defb &00,&7F,&CE,&00; line 2
defb &01,&FF,&EF,&00; line 3
defb &01,&7F,&CE,&00; line 4
defb &00,&79,&C2,&00; line 5
defb &00,&34,&84,&00; line 6
defb &00,&12,&08,&00; line 7
defb &00,&13,&08,&00; line 8
defb &00,&27,&8C,&00; line 9
defb &00,&5E,&4E,&00; line 10
defb &01,&BC,&A7,&00; line 11
defb &01,&78,&C3,&00; line 12
defb &00,&78,&C2,&00; line 13
defb &33,&FF,&FF,&88; line 14
defb &00,&00,&00,&00; line 15




.Coin1
defb &00,&77,&EE,&00; line 0
defb &11,&CF,&3F,&88; line 1
defb &33,&3C,&C3,&CC; line 2
defb &67,&E1,&78,&6E; line 3
defb &56,&D2,&F4,&A6; line 4
defb &DE,&D2,&F4,&B7; line 5
defb &BC,&D2,&F4,&D3; line 6
defb &BC,&D2,&F4,&D3; line 7
defb &BC,&D2,&F4,&D3; line 8
defb &BC,&D2,&F4,&D3; line 9
defb &DE,&D2,&F4,&B7; line 10
defb &56,&D2,&F4,&A6; line 11
defb &67,&F1,&F8,&6E; line 12
defb &33,&3C,&C3,&CC; line 13
defb &11,&CF,&3F,&88; line 14
defb &00,&77,&EE,&00; line 15




.Ice1
defb &F0,&D2,&F0,&E1; line 0
defb &F0,&B4,&F0,&C3; line 1
defb &F0,&78,&F0,&A5; line 2
defb &E1,&F0,&F0,&69; line 3
defb &D2,&F0,&E1,&E1; line 4
defb &B4,&F0,&D2,&E1; line 5
defb &78,&F0,&B4,&E1; line 6
defb &F0,&F0,&78,&E1; line 7
defb &F0,&E1,&F0,&E1; line 8
defb &F0,&D2,&F0,&C3; line 9
defb &F0,&B4,&F0,&A5; line 10
defb &F0,&78,&F0,&69; line 11
defb &E1,&F0,&E1,&E1; line 12
defb &D2,&F0,&D2,&E1; line 13
defb &B4,&F0,&B4,&E1; line 14
defb &0F,&0F,&0F,&0F; line 15




.Trap1
defb &A5,&A5,&A5,&A5; line 0
defb &5F,&DF,&5F,&DF; line 1
defb &B7,&FF,&B7,&FF; line 2
defb &7F,&FF,&7F,&FF; line 3
defb &F7,&FF,&F7,&FF; line 4
defb &7F,&DF,&7F,&DF; line 5
defb &B7,&BF,&B7,&BF; line 6
defb &7F,&FF,&7F,&FF; line 7
defb &A5,&A5,&A5,&A5; line 8
defb &5F,&DF,&5F,&DF; line 9
defb &B7,&FF,&B7,&FF; line 10
defb &7F,&FF,&7F,&FF; line 11
defb &F7,&FF,&F7,&FF; line 12
defb &7F,&DF,&7F,&DF; line 13
defb &B7,&BF,&B7,&BF; line 14
defb &7F,&FF,&7F,&FF; line 15




.Trap2
defb &A5,&A5,&A5,&A5; line 0
defb &4F,&3F,&4F,&3F; line 1
defb &96,&97,&96,&97; line 2
defb &2D,&5B,&2D,&5B; line 3
defb &A5,&5B,&A5,&5B; line 4
defb &1E,&97,&1E,&97; line 5
defb &C7,&3F,&C7,&3F; line 6
defb &7F,&FF,&7F,&FF; line 7
defb &A5,&A5,&A5,&A5; line 8
defb &4F,&3F,&4F,&3F; line 9
defb &96,&97,&96,&97; line 10
defb &2D,&5B,&2D,&5B; line 11
defb &A5,&5B,&A5,&5B; line 12
defb &1E,&97,&1E,&97; line 13
defb &C7,&3F,&C7,&3F; line 14
defb &7F,&FF,&7F,&FF; line 15




.SwitchU
defb &00,&33,&CC,&00; line 0
defb &00,&47,&2E,&00; line 1
defb &00,&47,&2E,&00; line 2
defb &00,&23,&4C,&00; line 3
defb &FF,&FF,&FF,&FF; line 4
defb &F8,&F1,&F8,&F1; line 5
defb &EB,&3F,&CF,&3D; line 6
defb &DA,&F1,&F8,&F1; line 7
defb &DA,&F1,&78,&F1; line 8
defb &DA,&E1,&F8,&F1; line 9
defb &F8,&F0,&F0,&F1; line 10
defb &FF,&FF,&FF,&FF; line 11
defb &00,&00,&00,&00; line 12
defb &00,&00,&00,&00; line 13
defb &00,&00,&00,&00; line 14
defb &00,&00,&00,&00; line 15




.SwitchD
defb &00,&00,&00,&00; line 0
defb &00,&00,&00,&00; line 1
defb &00,&00,&00,&00; line 2
defb &00,&00,&00,&00; line 3
defb &FF,&FF,&FF,&FF; line 4
defb &F8,&F0,&F0,&F1; line 5
defb &EB,&3F,&4F,&3D; line 6
defb &DA,&E1,&F8,&F1; line 7
defb &DA,&F1,&F8,&F1; line 8
defb &DA,&F1,&F8,&F1; line 9
defb &F8,&F1,&F8,&F1; line 10
defb &FF,&FF,&FF,&FF; line 11
defb &00,&23,&4C,&00; line 12
defb &00,&47,&2E,&00; line 13
defb &00,&47,&2E,&00; line 14
defb &00,&33,&CC,&00; line 15

EgoTrip

#7
Heres the second line of 20 sprites


.PlayerU
defb &00,&23,&4C,&00; line 0
defb &00,&76,&E6,&00; line 1
defb &00,&FF,&FF,&00; line 2
defb &55,&F8,&F1,&AA; line 3
defb &CD,&F9,&F9,&3B; line 4
defb &EF,&7F,&EF,&7F; line 5
defb &DD,&7F,&EF,&BB; line 6
defb &44,&8F,&1F,&22; line 7
defb &11,&2D,&4B,&88; line 8
defb &45,&69,&69,&2A; line 9
defb &CD,&0F,&0F,&3B; line 10
defb &EF,&0F,&0F,&7F; line 11
defb &DD,&1E,&87,&BB; line 12
defb &44,&9E,&97,&22; line 13
defb &00,&47,&2E,&00; line 14
defb &00,&33,&CC,&00; line 15




.PlayerL
defb &00,&EE,&33,&88; line 0
defb &11,&FF,&77,&CC; line 1
defb &00,&44,&11,&00; line 2
defb &11,&2E,&8F,&88; line 3
defb &33,&9F,&0F,&4C; line 4
defb &76,&E7,&4B,&2E; line 5
defb &FE,&E7,&C3,&1F; line 6
defb &7A,&EF,&0F,&D3; line 7
defb &7A,&EF,&0F,&D3; line 8
defb &FE,&E7,&C3,&1F; line 9
defb &76,&E7,&4B,&2E; line 10
defb &33,&9F,&0F,&4C; line 11
defb &11,&2E,&8F,&88; line 12
defb &00,&44,&11,&00; line 13
defb &11,&FF,&77,&CC; line 14
defb &00,&EE,&33,&88; line 15




.PlayerR
defb &11,&CC,&77,&00; line 0
defb &33,&EE,&FF,&88; line 1
defb &00,&88,&22,&00; line 2
defb &11,&1F,&47,&88; line 3
defb &23,&0F,&9F,&CC; line 4
defb &47,&2D,&7E,&E6; line 5
defb &8F,&3C,&7E,&F7; line 6
defb &BC,&0F,&7F,&E5; line 7
defb &BC,&0F,&7F,&E5; line 8
defb &8F,&3C,&7E,&F7; line 9
defb &47,&2D,&7E,&E6; line 10
defb &23,&0F,&9F,&CC; line 11
defb &11,&1F,&47,&88; line 12
defb &00,&88,&22,&00; line 13
defb &33,&EE,&FF,&88; line 14
defb &11,&CC,&77,&00; line 15




.PlayerD
defb &00,&33,&CC,&00; line 0
defb &00,&47,&2E,&00; line 1
defb &44,&9E,&97,&22; line 2
defb &DD,&1E,&87,&BB; line 3
defb &EF,&0F,&0F,&7F; line 4
defb &CD,&0F,&0F,&3B; line 5
defb &45,&69,&69,&2A; line 6
defb &11,&2D,&4B,&88; line 7
defb &44,&8F,&1F,&22; line 8
defb &DD,&7F,&EF,&BB; line 9
defb &EF,&7F,&EF,&7F; line 10
defb &CD,&F9,&F9,&3B; line 11
defb &55,&F8,&F1,&AA; line 12
defb &00,&FF,&FF,&00; line 13
defb &00,&76,&E6,&00; line 14
defb &00,&23,&4C,&00; line 15




.ShipU
defb &00,&11,&88,&00; line 0
defb &00,&23,&4C,&00; line 1
defb &66,&56,&A6,&66; line 2
defb &60,&8F,&1F,&60; line 3
defb &66,&BF,&DF,&66; line 4
defb &06,&BF,&DF,&06; line 5
defb &06,&34,&C2,&06; line 6
defb &07,&3C,&C3,&0E; line 7
defb &07,&3C,&C3,&0E; line 8
defb &06,&34,&C2,&06; line 9
defb &06,&BC,&D3,&06; line 10
defb &66,&8B,&1D,&66; line 11
defb &00,&11,&88,&00; line 12
defb &00,&32,&C4,&00; line 13
defb &00,&30,&C0,&00; line 14
defb &00,&00,&00,&00; line 15




.ShipL
defb &00,&00,&00,&00; line 0
defb &00,&8F,&1F,&C4; line 1
defb &00,&8F,&1F,&C4; line 2
defb &00,&01,&08,&00; line 3
defb &00,&CD,&3B,&88; line 4
defb &00,&07,&0F,&4C; line 5
defb &62,&78,&F3,&2E; line 6
defb &71,&78,&F3,&5B; line 7
defb &71,&78,&F3,&5B; line 8
defb &62,&78,&F3,&2E; line 9
defb &00,&07,&0F,&4C; line 10
defb &00,&CD,&3B,&88; line 11
defb &00,&01,&08,&00; line 12
defb &00,&8F,&1F,&C4; line 13
defb &00,&8F,&1F,&C4; line 14
defb &00,&00,&00,&00; line 15




.ShipR
defb &00,&00,&00,&00; line 0
defb &32,&8F,&1F,&00; line 1
defb &32,&8F,&1F,&00; line 2
defb &00,&01,&08,&00; line 3
defb &11,&CD,&3B,&00; line 4
defb &23,&0F,&0E,&00; line 5
defb &47,&FC,&E1,&64; line 6
defb &AD,&FC,&E1,&E8; line 7
defb &AD,&FC,&E1,&E8; line 8
defb &47,&FC,&E1,&64; line 9
defb &23,&0F,&0E,&00; line 10
defb &11,&CD,&3B,&00; line 11
defb &00,&01,&08,&00; line 12
defb &32,&8F,&1F,&00; line 13
defb &32,&8F,&1F,&00; line 14
defb &00,&00,&00,&00; line 15




.ShipD
defb &00,&00,&00,&00; line 0
defb &00,&30,&C0,&00; line 1
defb &00,&32,&C4,&00; line 2
defb &00,&11,&88,&00; line 3
defb &66,&8B,&1D,&66; line 4
defb &06,&BC,&D3,&06; line 5
defb &06,&34,&C2,&06; line 6
defb &07,&3C,&C3,&0E; line 7
defb &07,&3C,&C3,&0E; line 8
defb &06,&34,&C2,&06; line 9
defb &06,&BF,&DF,&06; line 10
defb &66,&BF,&DF,&66; line 11
defb &60,&8F,&1F,&60; line 12
defb &66,&56,&A6,&66; line 13
defb &00,&23,&4C,&00; line 14
defb &00,&11,&88,&00; line 15




.Bubble1
defb &00,&77,&EE,&00; line 0
defb &11,&8F,&1F,&88; line 1
defb &23,&78,&E1,&4C; line 2
defb &56,&F0,&F0,&A6; line 3
defb &56,&F0,&F0,&A6; line 4
defb &BC,&F0,&F0,&D3; line 5
defb &BC,&F0,&F0,&D3; line 6
defb &BC,&F0,&F0,&D3; line 7
defb &BC,&F0,&F0,&D3; line 8
defb &BC,&F0,&F0,&D3; line 9
defb &BC,&F0,&F0,&D3; line 10
defb &56,&F0,&F0,&A6; line 11
defb &56,&F0,&F0,&A6; line 12
defb &23,&78,&E1,&4C; line 13
defb &11,&8F,&1F,&88; line 14
defb &00,&77,&EE,&00; line 15




.Bubble2
defb &00,&00,&00,&00; line 0
defb &00,&33,&CC,&00; line 1
defb &00,&CF,&3F,&00; line 2
defb &11,&3C,&C3,&88; line 3
defb &23,&F0,&F0,&4C; line 4
defb &23,&F0,&F0,&4C; line 5
defb &56,&F0,&F0,&A6; line 6
defb &56,&F0,&F0,&A6; line 7
defb &56,&F0,&F0,&A6; line 8
defb &56,&F0,&F0,&A6; line 9
defb &23,&F0,&F0,&4C; line 10
defb &23,&F0,&F0,&4C; line 11
defb &11,&3C,&C3,&88; line 12
defb &00,&CF,&3F,&00; line 13
defb &00,&33,&CC,&00; line 14
defb &00,&00,&00,&00; line 15




.Digit0
defb &32,&F0,&F0,&C4; line 0
defb &30,&0F,&0F,&48; line 1
defb &21,&3C,&E1,&C0; line 2
defb &30,&68,&43,&48; line 3
defb &21,&2C,&61,&C0; line 4
defb &30,&68,&43,&48; line 5
defb &21,&2C,&61,&C0; line 6
defb &32,&6A,&74,&C4; line 7
defb &21,&2C,&61,&C0; line 8
defb &30,&68,&43,&48; line 9
defb &21,&2C,&61,&C0; line 10
defb &30,&68,&43,&48; line 11
defb &21,&2C,&61,&C0; line 12
defb &30,&78,&C3,&48; line 13
defb &21,&0F,&0F,&C0; line 14
defb &32,&78,&F0,&C4; line 15




.Digit1
defb &00,&00,&74,&C4; line 0
defb &00,&77,&CB,&48; line 1
defb &00,&88,&61,&C0; line 2
defb &00,&88,&43,&48; line 3
defb &00,&88,&61,&C0; line 4
defb &00,&88,&43,&48; line 5
defb &00,&88,&61,&C0; line 6
defb &00,&77,&FC,&C4; line 7
defb &00,&88,&61,&C0; line 8
defb &00,&88,&43,&48; line 9
defb &00,&88,&61,&C0; line 10
defb &00,&88,&43,&48; line 11
defb &00,&88,&61,&C0; line 12
defb &00,&88,&43,&48; line 13
defb &00,&77,&CB,&C0; line 14
defb &00,&00,&74,&C4; line 15




.Digit2
defb &32,&F0,&F0,&C4; line 0
defb &30,&0F,&0F,&48; line 1
defb &32,&F0,&E1,&C0; line 2
defb &00,&88,&43,&48; line 3
defb &00,&88,&61,&C0; line 4
defb &00,&88,&43,&48; line 5
defb &11,&F0,&E1,&C0; line 6
defb &32,&0F,&0F,&48; line 7
defb &21,&3C,&E1,&C4; line 8
defb &30,&68,&11,&00; line 9
defb &21,&2C,&11,&00; line 10
defb &30,&68,&11,&00; line 11
defb &21,&2C,&11,&00; line 12
defb &30,&78,&F0,&C4; line 13
defb &21,&0F,&0F,&C0; line 14
defb &32,&78,&F0,&C4; line 15




.Digit3
defb &32,&F0,&E1,&C4; line 0
defb &30,&0F,&0F,&48; line 1
defb &32,&F0,&E1,&C0; line 2
defb &00,&88,&43,&48; line 3
defb &00,&88,&61,&C0; line 4
defb &00,&88,&43,&48; line 5
defb &32,&F0,&E1,&C0; line 6
defb &21,&0F,&1E,&C4; line 7
defb &32,&F0,&E1,&C0; line 8
defb &00,&88,&43,&48; line 9
defb &00,&88,&61,&C0; line 10
defb &00,&88,&43,&48; line 11
defb &00,&88,&61,&C0; line 12
defb &32,&F0,&C3,&48; line 13
defb &21,&0F,&0F,&C0; line 14
defb &32,&F0,&F0,&C4; line 15




.Digit4
defb &32,&E2,&65,&C4; line 0
defb &30,&68,&43,&48; line 1
defb &21,&2C,&61,&C0; line 2
defb &30,&68,&43,&48; line 3
defb &21,&2C,&61,&C0; line 4
defb &30,&68,&43,&48; line 5
defb &21,&3C,&E1,&C0; line 6
defb &30,&0F,&1E,&C4; line 7
defb &32,&F0,&E1,&C0; line 8
defb &00,&88,&43,&48; line 9
defb &00,&88,&61,&C0; line 10
defb &00,&88,&43,&48; line 11
defb &00,&88,&61,&C0; line 12
defb &00,&88,&43,&48; line 13
defb &00,&77,&E9,&C0; line 14
defb &00,&00,&74,&C4; line 15




.Digit5
defb &32,&F0,&F0,&C4; line 0
defb &30,&0F,&0F,&48; line 1
defb &21,&3C,&F0,&C4; line 2
defb &30,&68,&11,&00; line 3
defb &21,&2C,&11,&00; line 4
defb &30,&68,&11,&00; line 5
defb &21,&3C,&E1,&80; line 6
defb &30,&0F,&0F,&4C; line 7
defb &32,&F0,&E1,&C0; line 8
defb &00,&88,&43,&48; line 9
defb &00,&88,&61,&C0; line 10
defb &00,&88,&43,&48; line 11
defb &00,&88,&61,&C0; line 12
defb &32,&F0,&C3,&48; line 13
defb &30,&0F,&0F,&C0; line 14
defb &32,&F0,&F0,&C4; line 15




.Digit6
defb &32,&F0,&F0,&C4; line 0
defb &30,&0F,&0F,&48; line 1
defb &21,&3C,&F0,&C0; line 2
defb &30,&68,&11,&00; line 3
defb &21,&2C,&11,&00; line 4
defb &30,&68,&11,&00; line 5
defb &21,&3C,&F0,&C4; line 6
defb &32,&0F,&0F,&48; line 7
defb &21,&3C,&E1,&C0; line 8
defb &30,&68,&43,&48; line 9
defb &21,&2C,&61,&C0; line 10
defb &30,&68,&43,&48; line 11
defb &21,&2C,&61,&C0; line 12
defb &30,&78,&C3,&48; line 13
defb &21,&0F,&0F,&C0; line 14
defb &32,&78,&F0,&C4; line 15




.Digit7
defb &32,&F0,&F0,&C4; line 0
defb &21,&0F,&0F,&48; line 1
defb &32,&F0,&E1,&C0; line 2
defb &00,&88,&43,&48; line 3
defb &00,&88,&61,&C0; line 4
defb &00,&88,&43,&48; line 5
defb &00,&88,&61,&C0; line 6
defb &00,&77,&FC,&C4; line 7
defb &00,&88,&61,&C0; line 8
defb &00,&88,&43,&48; line 9
defb &00,&88,&61,&C0; line 10
defb &00,&88,&43,&48; line 11
defb &00,&88,&61,&C0; line 12
defb &00,&88,&43,&48; line 13
defb &00,&77,&CB,&C0; line 14
defb &00,&00,&74,&C4; line 15




.Digit8
defb &32,&F0,&F0,&C4; line 0
defb &30,&0F,&0F,&48; line 1
defb &21,&3C,&E1,&C0; line 2
defb &30,&68,&43,&48; line 3
defb &21,&2C,&61,&C0; line 4
defb &30,&68,&43,&48; line 5
defb &21,&3C,&E1,&C0; line 6
defb &32,&0F,&1E,&C4; line 7
defb &21,&3C,&E1,&C0; line 8
defb &30,&68,&43,&48; line 9
defb &21,&2C,&61,&C0; line 10
defb &30,&68,&43,&48; line 11
defb &21,&2C,&61,&C0; line 12
defb &30,&78,&C3,&48; line 13
defb &21,&0F,&0F,&C0; line 14
defb &32,&78,&F0,&C4; line 15




.Digit9
defb &32,&F0,&F0,&C4; line 0
defb &30,&0F,&0F,&48; line 1
defb &21,&3C,&E1,&C0; line 2
defb &30,&68,&43,&48; line 3
defb &21,&2C,&61,&C0; line 4
defb &30,&68,&43,&48; line 5
defb &21,&3C,&E1,&C0; line 6
defb &30,&0F,&1E,&C4; line 7
defb &32,&F0,&E1,&C0; line 8
defb &00,&88,&43,&48; line 9
defb &00,&88,&61,&C0; line 10
defb &00,&88,&43,&48; line 11
defb &00,&88,&61,&C0; line 12
defb &32,&F0,&C3,&48; line 13
defb &21,&0F,&0F,&C0; line 14
defb &32,&78,&F0,&C4; line 15

EgoTrip

Heres the mask lookup table which I figure you might need.


.maskLookupTable ; lookup table for masks, indexed by sprite byte. AND with screen data, then OR with pixel data.
defb &FF,&EE,&DD,&CC,&BB,&AA,&99,&88,&77,&66,&55,&44,&33,&22,&11,&00,&EE,&EE,&CC,&CC,&AA,&AA,&88,&88,&66,&66,&44,&44,&22,&22,&00,&00
defb &DD,&CC,&DD,&CC,&99,&88,&99,&88,&55,&44,&55,&44,&11,&00,&11,&00,&CC,&CC,&CC,&CC,&88,&88,&88,&88,&44,&44,&44,&44,&00,&00,&00,&00
defb &BB,&AA,&99,&88,&BB,&AA,&99,&88,&33,&22,&11,&00,&33,&22,&11,&00,&AA,&AA,&88,&88,&AA,&AA,&88,&88,&22,&22,&00,&00,&22,&22,&00,&00
defb &99,&88,&99,&88,&99,&88,&99,&88,&11,&00,&11,&00,&11,&00,&11,&00,&88,&88,&88,&88,&88,&88,&88,&88,&00,&00,&00,&00,&00,&00,&00,&00
defb &77,&66,&55,&44,&33,&22,&11,&00,&77,&66,&55,&44,&33,&22,&11,&00,&66,&66,&44,&44,&22,&22,&00,&00,&66,&66,&44,&44,&22,&22,&00,&00
defb &55,&44,&55,&44,&11,&00,&11,&00,&55,&44,&55,&44,&11,&00,&11,&00,&44,&44,&44,&44,&00,&00,&00,&00,&44,&44,&44,&44,&00,&00,&00,&00
defb &33,&22,&11,&00,&33,&22,&11,&00,&33,&22,&11,&00,&33,&22,&11,&00,&22,&22,&00,&00,&22,&22,&00,&00,&22,&22,&00,&00,&22,&22,&00,&00
defb &11,&00,&11,&00,&11,&00,&11,&00,&11,&00,&11,&00,&11,&00,&11,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00

db6128

Thanks! I will have a look and see what I can do soon. I don't think it'll be very difficult. (Shameless plug: here's something I made earlier :D) I will be sure not to promise anything, though, as I don't want to disappoint you when you're clearly very keen to get this started. So, if one of the many other people who know more than me does offer you a routine, feel free to go ahead with that. But otherwise, I'll be happy to give it a try!

Out of interest, were these tables made by AmSprite? I've only had a quick look at its generated code, but those seem familiar. I seem to recall that its sprite-plotting routine didn't look really optimal when I glanced at it, but maybe I'm wrong. Anyway, no offence to the program: it's pretty good overall.
Quote from: Devilmarkus on 13:04, 27 February 12
Quote from: ukmarkh on 11:38, 27 February 12[The owner of one of the few existing cartridges of Chase HQ 2] mentioned to me that unless someone could find a way to guarantee the code wouldn't be duplicated to anyone else, he wouldn't be interested.
Did he also say things like "My treasureeeeee" and is he a little grey guy?

db6128

#10
Hello, I have gotten started on this, just to let you know!

I've just assumed that you want to store a single copy of each sprite, i.e. with masks stored elsewhere (useful table you provided - thanks!) and with shifting done in real-time, not using pre-calculated copies of each sprite.

In that spirit, my non-shifted bit (i.e. for when x MOD 4 = 0) is looking beautiful! :) However, I'm about to find out whether the shifting allows me to retain such fine control over this relatively limited set of registers. :O

I'll let you know once I have something finished and have put it through the right tests. :D

Edit: Considering the format of the masking table, should I assume you want simply to use INK 0 to indicate transparency, thus effectively making your sprites 3-colour? If not, i.e. if you want 4-colour sprites, we would need to store individual masks for each byte of the sprite, interleaved with the pixel data, thus doubling the size for that sprite. I'll carry on with what I'm writing just now as it's going well and will be handy for me in the future in any case :) but I'd appreciate if you can be more specific about what you're looking for.

Edit again: This code is beautiful! I'm quite surprised: I typed it up without testing it as I went along - which I usually do, and which usually reveals millions of problems - and I made large changes to my approach a few times, which adds to the risk-factor. Yet I carried on, made a test sprite in AMSprite, and put it in - and it actually worked first time! Admittedly, one of the shifting levels had one little bug left, but I think this is the quickest I've been able to code something without being overrun by bugs, even if I did test it - definitely for the Z80, and possibly overall! Next up, I will do more testing just to be sure, trying some of your sprites this time. I'll post it once I'm sure, which I don't think will take long. :D

Having looked properly at the images you posted, the sprites seem only to use three colours, so I'm guessing that (as I wondered earlier) reserving INK 0 exclusively for transparency will be OK. However, as I said above, it wouldn't be too difficult to add 'full' masking, in case you really wanted to include solid areas of INK 0 in any sprites; however, I don't know if that would be of any real use. Anyway, let me know if you have any thoughts!
Quote from: Devilmarkus on 13:04, 27 February 12
Quote from: ukmarkh on 11:38, 27 February 12[The owner of one of the few existing cartridges of Chase HQ 2] mentioned to me that unless someone could find a way to guarantee the code wouldn't be duplicated to anyone else, he wouldn't be interested.
Did he also say things like "My treasureeeeee" and is he a little grey guy?

EgoTrip

Thanks for working on this. Yes, the sprites are 3 colour, using INK 0 as transparent.


I know nothing about the masking table, it was output automatically by RGAS (formerly Amsprite). I included it just in case you needed it. All this technical stuff is beyond me which is why I need help.

db6128

Quote from: EgoTrip on 00:28, 09 December 12Thanks for working on this.
No problem; I'm glad to be able to help someone out, and it was actually really fun - and educational - trying to write the best routine I could. There were fewer stupid mistakes than normal, too!

I'll get something together to show you soon, maybe some kind of demo with some sprites moving around; that's another thing that'll be good experience for me. Moving things around on a screen wasn't something I'd really ever done (neither BASIC nor the Game of Life really count, I think!) until just today, when I made a quite decent little 2D starfield. All I've done with your sprites so far is to write a loop that randomly plots the little bug guy on the screen in a big pile, so something more sophisticated is needed. :D

QuoteYes, the sprites are 3 colour, using INK 0 as transparent.
Great, then that's ideal. Coupled with the masking table, this is a very fast format that lends itself well to some easy and elegant machine code. Thankfully!

QuoteI know nothing about the masking table, it was output automatically by RGAS (formerly Amsprite). I included it just in case you needed it. All this technical stuff is beyond me which is why I need help.
Of course, and I'm glad to help where I can. Once the basics like spriting and screen setup are set in stone, I'll see if there's anything else I can do! Having said that, more complex things such as programming game logic are foreign to me, so someone else might be a better collaborator there. You never know, though! :)

Also, I didn't realise Amsprite had evolved, so that'll be interesting to check out.
Quote from: Devilmarkus on 13:04, 27 February 12
Quote from: ukmarkh on 11:38, 27 February 12[The owner of one of the few existing cartridges of Chase HQ 2] mentioned to me that unless someone could find a way to guarantee the code wouldn't be duplicated to anyone else, he wouldn't be interested.
Did he also say things like "My treasureeeeee" and is he a little grey guy?

Powered by SMFPacks Menu Editor Mod