Jump to content

Photo

[xx] 6-Bit Address Hack


2 replies to this topic

#1 Buckaroo OFFLINE  

Buckaroo

    Space Invader

  • 19 posts
  • Location:Plymouth, UK

Posted Thu May 18, 2017 1:06 PM

While working on something completely unrelated I found that you can use [xx] in Visual BB to access most of the commands,variables,sounds etc...

 

E.g. player0x=10 is exactly the same as [128]=10

 

Some of the variables do require you to update them every frame (NUSIZ0 for example)

 

If you just use it once it seems to cost you more bytes, but if you can use a loop to set multiple items at the same time you can save loads of bytes.

 

    6-bit address 1.0.bas

       Use Joy0 L/R to select item to edit
       Use Joy0 U/D to edit values
       Hold Joy0 fire to increase the amount to change

 

       First 3 digits of score are the item you're editing [xxx]
       Last 3 digits of score are the value

 

    Checkerboard.bas

       Demonstration of playfield usage with 2820 bytes to spare

 

The best use I've found so far is on the playfield, you're able to set segments of 8 pixels directly and it seems to be really fast at doing it (seems to be faster than pfline).

 

 

Here is an incomplete list of the links I've found so far, if you can help me fill the gaps I'd appreciate it:

Red items are ones I've not been able to confirm

 

0 VSYNC               128 player0x
1 VBLANK              129 player1x
2 WSYNC              130 missile0x
3 RSYNC               131 missile1x
4 NUSIZ0                132 ballx
5 NUSIZ1                133 player0y
6 COLUP0              134 player1y
7 COLUP1              135 missile1height
8 COLUPF              136 missile1y
9 COLUBK              137 bally
10 CTRLPF            138 player0pointerlo
11 REFP0               139 player0pointerhi
12 REFP1              140 player1pointerlo
13 PF0                   141 player1pointerhi
14 PF1               142 player0height
15 PF2               143 player1height
16 RESP0           144 missile0height
17 RESP1           145 missile0y
18 RESM0          146 ballheight
19 RESM1          147 XX000 score
20 RESBL          148 00XX00 score
21 AUDC0             149 000XX score
22 AUDC1         
23 AUDF0             163 scorecolor
24 AUDF1         
25 AUDV0             164-207 playfield (see below)
26 AUDV1         
27 GRP0            212-237 Variables a-z
28 GRP1         
29 ENAM0             239 playfieldpos
30 ENAM1         
31 ENABL             254 Inaccessible
32 HMP0         
33 HMP1           255 RESET?
34 HMM0         
35 HMM1         
36 HMBL         
37 VDELP0         

38 VDELP1         
39 VDELBL         
40 RESMP0         
41 RESMP1         

42 HMOVE         
43 HMCLR         
44 CXCLR         


64-108 same as 0-44          

 

Playfield positions blue for reversed bit order

 

__________________

| 164 | 165 | 166 | 167 |

| 168 | 169 | 170 | 171 |

| 172 | 173 | 174 | 175 |

| 176 | 177 | 178 | 179 |

| 180 | 181 | 182 | 183 |

| 184 | 185 | 186 | 187 |

| 188 | 189 | 190 | 191 |

| 192 | 193 | 194 | 195 |

| 196 | 197 | 198 | 199 |

| 200 | 201 | 202 | 203 |

| 204 | 205 | 206 | 207 |

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

Attached Files



#2 bogax OFFLINE  

bogax

    Dragonstomper

  • 704 posts

Posted Thu May 18, 2017 7:50 PM

that's a bug not a feature

 

if you omit the base reference so does bB and DASM (apparently) defaults to 0

I assume it clears a parameter and it stays cleared if you don't change it

 

however, you can include a constant (in this context a variable name is a constant)

the variables are in order so eg  a[3] is the same location as d



#3 Buckaroo OFFLINE  

Buckaroo

    Space Invader

  • Topic Starter
  • 19 posts
  • Location:Plymouth, UK

Posted Thu May 18, 2017 9:20 PM

that's a bug not a feature

 

Thanks for the information. I couldn't find a reference to this anywhere so thought it was a hack.

 

Is there a list which will tell me where all 255 of them point to?

 

If there are any that are unused then I can use them to store data in and get a couple of extra variables.

 

I've also tried it with different Kernels and the reference numbers change for each.






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users