Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_28.ADF » L/+Belis3
L/+Belis3
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_28.ADF |
Filename: | L/+Belis3 |
Read OK: | ✔ |
File size: | 0B0D bytes |
Load address: | 2B204556 |
Exec address: | 696C6542 |
File contents
Find routines which point to the messages, and also ones which change vectors or poke the CRTC registers (not sure about ELK equivalent here). You will need a table of opcodes, such as is provided in part 2 of the Master reference manual, in order to work in hex. I have found the following program useful for finding routines which use key locations: 10 FOR I% = &xxxx to & yyyy 20 IF ?I%=&ll AND ?(I%+1)=&hh THEN PRINT ~(I%-1),~!(I%-1) 30 NEXT I% the program searches from &xxxx to &yyyy for all occurrences of instructions which use location &hhll. The output is as follows: 2416 603456AD = LDA&5634 : RTS, beginning at &2416 N.B. beware of bogus output from data areas - check the surrounding code in each case. To trace a routine which points to a message, set &hhll to be the location of the message which you noted down from using *DUMP. An example to find pokes or peeks to the CRTC registers: 20 IF ?I%<=1 AND ?(I%+1)=&FE THEN PRINT ~(I%-1),~!(I%-1) Using the above line as line 20 will yield all the uses of locations &FE00 and &FE01 - I shall use this to find the hardware scrolling routines by looking at what is loaded into X and Y registers before the pokes - if X = &0C or &0D and the program gives: mmmm xxFE008E = STX&FE00 this will indicate that the game is poking the CRTC registers which control hardware scrolling from location mmmm. As well as looking for this, and routines which perform a loop containing LDX #0 initialise index register .loop LDA (&zz),X get character of message JSR oswrch print character CMP #0 test for null character BEQ exit exit the loop if the last character has been printed INX increment the index register BNE loop loop back for another character (the message is unlikely to be as long as 256 bytes, so the Z flag will be non-zero so BNE will act as a branch-always) .exit ... I shall look for call to system routines: xxFFF420 = JSR osbyte etc... To find sprites (this is the reason why I saved a reloadable portion of memory earlier), *LOAD MEM2 3000, and you can pick out the sprites on the screen. You can then find the sprite plotting routine by looking for code such as: LDA#sprite_location MOD 256 set two bytes in zero-page to point to STA&zz the sprite location. LDA#sprite_location DIV 256 STA&zz+1 LDY#0 .loop LDA(&zz),Y load byte of sprite STA&ssss,Y save to screen location INY CPY#8 8 = example height of sprite BCC loop loop if Y < 8 ... .sprite_location <data> I hope that you can decode games as well as this letter - if so, you should each be able to write excellent games for us all to play! Happy hacking. Mark Bellis 118, The Lawns, Rolleston-on-Dove, Burton-on-Trent, Staffs, DE13 9DE
00000000 0d 46 69 6e 64 20 72 6f 75 74 69 6e 65 73 20 77 |.Find routines w| 00000010 68 69 63 68 20 70 6f 69 6e 74 20 74 6f 20 74 68 |hich point to th| 00000020 65 20 6d 65 73 73 61 67 65 73 2c 20 61 6e 64 20 |e messages, and | 00000030 61 6c 73 6f 20 6f 6e 65 73 20 77 68 69 63 68 20 |also ones which | 00000040 63 68 61 6e 67 65 0d 76 65 63 74 6f 72 73 20 6f |change.vectors o| 00000050 72 20 70 6f 6b 65 20 74 68 65 20 43 52 54 43 20 |r poke the CRTC | 00000060 72 65 67 69 73 74 65 72 73 20 28 6e 6f 74 20 73 |registers (not s| 00000070 75 72 65 20 61 62 6f 75 74 20 45 4c 4b 20 65 71 |ure about ELK eq| 00000080 75 69 76 61 6c 65 6e 74 20 68 65 72 65 29 2e 0d |uivalent here)..| 00000090 0d 59 6f 75 20 77 69 6c 6c 20 6e 65 65 64 20 61 |.You will need a| 000000a0 20 74 61 62 6c 65 20 6f 66 20 6f 70 63 6f 64 65 | table of opcode| 000000b0 73 2c 20 73 75 63 68 20 61 73 20 69 73 20 70 72 |s, such as is pr| 000000c0 6f 76 69 64 65 64 20 69 6e 20 70 61 72 74 20 32 |ovided in part 2| 000000d0 20 6f 66 20 74 68 65 0d 4d 61 73 74 65 72 20 72 | of the.Master r| 000000e0 65 66 65 72 65 6e 63 65 20 6d 61 6e 75 61 6c 2c |eference manual,| 000000f0 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 77 6f 72 | in order to wor| 00000100 6b 20 69 6e 20 68 65 78 2e 0d 0d 49 20 68 61 76 |k in hex...I hav| 00000110 65 20 66 6f 75 6e 64 20 74 68 65 20 66 6f 6c 6c |e found the foll| 00000120 6f 77 69 6e 67 20 70 72 6f 67 72 61 6d 20 75 73 |owing program us| 00000130 65 66 75 6c 20 66 6f 72 20 66 69 6e 64 69 6e 67 |eful for finding| 00000140 20 72 6f 75 74 69 6e 65 73 20 77 68 69 63 68 0d | routines which.| 00000150 75 73 65 20 6b 65 79 20 6c 6f 63 61 74 69 6f 6e |use key location| 00000160 73 3a 0d 0d 31 30 20 46 4f 52 20 49 25 20 3d 20 |s:..10 FOR I% = | 00000170 26 78 78 78 78 20 74 6f 20 26 20 79 79 79 79 0d |&xxxx to & yyyy.| 00000180 32 30 20 49 46 20 3f 49 25 3d 26 6c 6c 20 41 4e |20 IF ?I%=&ll AN| 00000190 44 20 3f 28 49 25 2b 31 29 3d 26 68 68 20 54 48 |D ?(I%+1)=&hh TH| 000001a0 45 4e 20 50 52 49 4e 54 20 7e 28 49 25 2d 31 29 |EN PRINT ~(I%-1)| 000001b0 2c 7e 21 28 49 25 2d 31 29 0d 33 30 20 4e 45 58 |,~!(I%-1).30 NEX| 000001c0 54 20 49 25 0d 0d 74 68 65 20 70 72 6f 67 72 61 |T I%..the progra| 000001d0 6d 20 73 65 61 72 63 68 65 73 20 66 72 6f 6d 20 |m searches from | 000001e0 26 78 78 78 78 20 74 6f 20 26 79 79 79 79 20 66 |&xxxx to &yyyy f| 000001f0 6f 72 20 61 6c 6c 20 6f 63 63 75 72 72 65 6e 63 |or all occurrenc| 00000200 65 73 20 6f 66 0d 69 6e 73 74 72 75 63 74 69 6f |es of.instructio| 00000210 6e 73 20 77 68 69 63 68 20 75 73 65 20 6c 6f 63 |ns which use loc| 00000220 61 74 69 6f 6e 20 26 68 68 6c 6c 2e 0d 0d 54 68 |ation &hhll...Th| 00000230 65 20 6f 75 74 70 75 74 20 69 73 20 61 73 20 66 |e output is as f| 00000240 6f 6c 6c 6f 77 73 3a 0d 0d 32 34 31 36 20 20 20 |ollows:..2416 | 00000250 36 30 33 34 35 36 41 44 20 20 20 20 20 20 20 20 |603456AD | 00000260 20 3d 20 4c 44 41 26 35 36 33 34 20 3a 20 52 54 | = LDA&5634 : RT| 00000270 53 2c 20 62 65 67 69 6e 6e 69 6e 67 20 61 74 20 |S, beginning at | 00000280 26 32 34 31 36 0d 0d 4e 2e 42 2e 20 62 65 77 61 |&2416..N.B. bewa| 00000290 72 65 20 6f 66 20 62 6f 67 75 73 20 6f 75 74 70 |re of bogus outp| 000002a0 75 74 20 66 72 6f 6d 20 64 61 74 61 20 61 72 65 |ut from data are| 000002b0 61 73 20 2d 20 63 68 65 63 6b 20 74 68 65 20 73 |as - check the s| 000002c0 75 72 72 6f 75 6e 64 69 6e 67 20 63 6f 64 65 0d |urrounding code.| 000002d0 69 6e 20 65 61 63 68 20 63 61 73 65 2e 0d 0d 54 |in each case...T| 000002e0 6f 20 74 72 61 63 65 20 61 20 72 6f 75 74 69 6e |o trace a routin| 000002f0 65 20 77 68 69 63 68 20 70 6f 69 6e 74 73 20 74 |e which points t| 00000300 6f 20 61 20 6d 65 73 73 61 67 65 2c 20 73 65 74 |o a message, set| 00000310 20 26 68 68 6c 6c 20 74 6f 20 62 65 20 74 68 65 | &hhll to be the| 00000320 20 6c 6f 63 61 74 69 6f 6e 0d 6f 66 20 74 68 65 | location.of the| 00000330 20 6d 65 73 73 61 67 65 20 77 68 69 63 68 20 79 | message which y| 00000340 6f 75 20 6e 6f 74 65 64 20 64 6f 77 6e 20 66 72 |ou noted down fr| 00000350 6f 6d 20 75 73 69 6e 67 20 2a 44 55 4d 50 2e 0d |om using *DUMP..| 00000360 0d 41 6e 20 65 78 61 6d 70 6c 65 20 74 6f 20 66 |.An example to f| 00000370 69 6e 64 20 70 6f 6b 65 73 20 6f 72 20 70 65 65 |ind pokes or pee| 00000380 6b 73 20 74 6f 20 74 68 65 20 43 52 54 43 20 72 |ks to the CRTC r| 00000390 65 67 69 73 74 65 72 73 3a 0d 0d 32 30 20 49 46 |egisters:..20 IF| 000003a0 20 3f 49 25 3c 3d 31 20 41 4e 44 20 3f 28 49 25 | ?I%<=1 AND ?(I%| 000003b0 2b 31 29 3d 26 46 45 20 54 48 45 4e 20 50 52 49 |+1)=&FE THEN PRI| 000003c0 4e 54 20 7e 28 49 25 2d 31 29 2c 7e 21 28 49 25 |NT ~(I%-1),~!(I%| 000003d0 2d 31 29 0d 0d 55 73 69 6e 67 20 74 68 65 20 61 |-1)..Using the a| 000003e0 62 6f 76 65 20 6c 69 6e 65 20 61 73 20 6c 69 6e |bove line as lin| 000003f0 65 20 32 30 20 77 69 6c 6c 20 79 69 65 6c 64 20 |e 20 will yield | 00000400 61 6c 6c 20 74 68 65 20 75 73 65 73 20 6f 66 20 |all the uses of | 00000410 6c 6f 63 61 74 69 6f 6e 73 0d 26 46 45 30 30 20 |locations.&FE00 | 00000420 61 6e 64 20 26 46 45 30 31 20 2d 20 49 20 73 68 |and &FE01 - I sh| 00000430 61 6c 6c 20 75 73 65 20 74 68 69 73 20 74 6f 20 |all use this to | 00000440 66 69 6e 64 20 74 68 65 20 68 61 72 64 77 61 72 |find the hardwar| 00000450 65 20 73 63 72 6f 6c 6c 69 6e 67 20 72 6f 75 74 |e scrolling rout| 00000460 69 6e 65 73 0d 62 79 20 6c 6f 6f 6b 69 6e 67 20 |ines.by looking | 00000470 61 74 20 77 68 61 74 20 69 73 20 6c 6f 61 64 65 |at what is loade| 00000480 64 20 69 6e 74 6f 20 58 20 61 6e 64 20 59 20 72 |d into X and Y r| 00000490 65 67 69 73 74 65 72 73 20 62 65 66 6f 72 65 20 |egisters before | 000004a0 74 68 65 20 70 6f 6b 65 73 20 2d 20 69 66 0d 58 |the pokes - if.X| 000004b0 20 3d 20 26 30 43 20 6f 72 20 26 30 44 20 61 6e | = &0C or &0D an| 000004c0 64 20 74 68 65 20 70 72 6f 67 72 61 6d 20 67 69 |d the program gi| 000004d0 76 65 73 3a 0d 0d 6d 6d 6d 6d 20 20 20 78 78 46 |ves:..mmmm xxF| 000004e0 45 30 30 38 45 20 20 20 20 20 20 20 20 20 3d 20 |E008E = | 000004f0 53 54 58 26 46 45 30 30 0d 0d 74 68 69 73 20 77 |STX&FE00..this w| 00000500 69 6c 6c 20 69 6e 64 69 63 61 74 65 20 74 68 61 |ill indicate tha| 00000510 74 20 74 68 65 20 67 61 6d 65 20 69 73 20 70 6f |t the game is po| 00000520 6b 69 6e 67 20 74 68 65 20 43 52 54 43 20 72 65 |king the CRTC re| 00000530 67 69 73 74 65 72 73 20 77 68 69 63 68 0d 63 6f |gisters which.co| 00000540 6e 74 72 6f 6c 20 68 61 72 64 77 61 72 65 20 73 |ntrol hardware s| 00000550 63 72 6f 6c 6c 69 6e 67 20 66 72 6f 6d 20 6c 6f |crolling from lo| 00000560 63 61 74 69 6f 6e 20 6d 6d 6d 6d 2e 0d 0d 41 73 |cation mmmm...As| 00000570 20 77 65 6c 6c 20 61 73 20 6c 6f 6f 6b 69 6e 67 | well as looking| 00000580 20 66 6f 72 20 74 68 69 73 2c 20 61 6e 64 20 72 | for this, and r| 00000590 6f 75 74 69 6e 65 73 20 77 68 69 63 68 20 70 65 |outines which pe| 000005a0 72 66 6f 72 6d 20 61 20 6c 6f 6f 70 20 63 6f 6e |rform a loop con| 000005b0 74 61 69 6e 69 6e 67 0d 0d 4c 44 58 20 23 30 20 |taining..LDX #0 | 000005c0 20 20 20 20 20 20 20 20 69 6e 69 74 69 61 6c 69 | initiali| 000005d0 73 65 20 69 6e 64 65 78 20 72 65 67 69 73 74 65 |se index registe| 000005e0 72 0d 2e 6c 6f 6f 70 0d 4c 44 41 20 28 26 7a 7a |r..loop.LDA (&zz| 000005f0 29 2c 58 20 20 20 20 67 65 74 20 63 68 61 72 61 |),X get chara| 00000600 63 74 65 72 20 6f 66 20 6d 65 73 73 61 67 65 0d |cter of message.| 00000610 4a 53 52 20 6f 73 77 72 63 68 20 20 20 20 20 70 |JSR oswrch p| 00000620 72 69 6e 74 20 63 68 61 72 61 63 74 65 72 0d 43 |rint character.C| 00000630 4d 50 20 23 30 20 20 20 20 20 20 20 20 20 74 65 |MP #0 te| 00000640 73 74 20 66 6f 72 20 6e 75 6c 6c 20 63 68 61 72 |st for null char| 00000650 61 63 74 65 72 0d 42 45 51 20 65 78 69 74 20 20 |acter.BEQ exit | 00000660 20 20 20 20 20 65 78 69 74 20 74 68 65 20 6c 6f | exit the lo| 00000670 6f 70 20 69 66 20 74 68 65 20 6c 61 73 74 20 63 |op if the last c| 00000680 68 61 72 61 63 74 65 72 20 68 61 73 20 62 65 65 |haracter has bee| 00000690 6e 20 70 72 69 6e 74 65 64 0d 49 4e 58 20 20 20 |n printed.INX | 000006a0 20 20 20 20 20 20 20 20 20 69 6e 63 72 65 6d 65 | increme| 000006b0 6e 74 20 74 68 65 20 69 6e 64 65 78 20 72 65 67 |nt the index reg| 000006c0 69 73 74 65 72 0d 42 4e 45 20 6c 6f 6f 70 20 20 |ister.BNE loop | 000006d0 20 20 20 20 20 6c 6f 6f 70 20 62 61 63 6b 20 66 | loop back f| 000006e0 6f 72 20 61 6e 6f 74 68 65 72 20 63 68 61 72 61 |or another chara| 000006f0 63 74 65 72 20 28 74 68 65 20 6d 65 73 73 61 67 |cter (the messag| 00000700 65 20 69 73 20 75 6e 6c 69 6b 65 6c 79 0d 20 20 |e is unlikely. | 00000710 20 20 20 20 20 20 20 20 20 20 20 20 20 74 6f 20 | to | 00000720 62 65 20 61 73 20 6c 6f 6e 67 20 61 73 20 32 35 |be as long as 25| 00000730 36 20 62 79 74 65 73 2c 20 73 6f 20 74 68 65 20 |6 bytes, so the | 00000740 5a 20 66 6c 61 67 20 77 69 6c 6c 20 62 65 20 6e |Z flag will be n| 00000750 6f 6e 2d 7a 65 72 6f 0d 20 20 20 20 20 20 20 20 |on-zero. | 00000760 20 20 20 20 20 20 20 73 6f 20 42 4e 45 20 77 69 | so BNE wi| 00000770 6c 6c 20 61 63 74 20 61 73 20 61 20 62 72 61 6e |ll act as a bran| 00000780 63 68 2d 61 6c 77 61 79 73 29 0d 2e 65 78 69 74 |ch-always)..exit| 00000790 0d 2e 2e 2e 0d 0d 49 20 73 68 61 6c 6c 20 6c 6f |......I shall lo| 000007a0 6f 6b 20 66 6f 72 20 63 61 6c 6c 20 74 6f 20 73 |ok for call to s| 000007b0 79 73 74 65 6d 20 72 6f 75 74 69 6e 65 73 3a 20 |ystem routines: | 000007c0 78 78 46 46 46 34 32 30 20 3d 20 4a 53 52 20 6f |xxFFF420 = JSR o| 000007d0 73 62 79 74 65 20 65 74 63 2e 2e 2e 0d 0d 54 6f |sbyte etc.....To| 000007e0 20 66 69 6e 64 20 73 70 72 69 74 65 73 20 28 74 | find sprites (t| 000007f0 68 69 73 20 69 73 20 74 68 65 20 72 65 61 73 6f |his is the reaso| 00000800 6e 20 77 68 79 20 49 20 73 61 76 65 64 20 61 20 |n why I saved a | 00000810 72 65 6c 6f 61 64 61 62 6c 65 20 70 6f 72 74 69 |reloadable porti| 00000820 6f 6e 20 6f 66 0d 6d 65 6d 6f 72 79 20 65 61 72 |on of.memory ear| 00000830 6c 69 65 72 29 2c 20 2a 4c 4f 41 44 20 4d 45 4d |lier), *LOAD MEM| 00000840 32 20 33 30 30 30 2c 20 61 6e 64 20 79 6f 75 20 |2 3000, and you | 00000850 63 61 6e 20 70 69 63 6b 20 6f 75 74 20 74 68 65 |can pick out the| 00000860 20 73 70 72 69 74 65 73 20 6f 6e 0d 74 68 65 20 | sprites on.the | 00000870 73 63 72 65 65 6e 2e 20 20 59 6f 75 20 63 61 6e |screen. You can| 00000880 20 74 68 65 6e 20 66 69 6e 64 20 74 68 65 20 73 | then find the s| 00000890 70 72 69 74 65 20 70 6c 6f 74 74 69 6e 67 20 72 |prite plotting r| 000008a0 6f 75 74 69 6e 65 20 62 79 20 6c 6f 6f 6b 69 6e |outine by lookin| 000008b0 67 20 66 6f 72 0d 63 6f 64 65 20 73 75 63 68 20 |g for.code such | 000008c0 61 73 3a 0d 0d 4c 44 41 23 73 70 72 69 74 65 5f |as:..LDA#sprite_| 000008d0 6c 6f 63 61 74 69 6f 6e 20 4d 4f 44 20 32 35 36 |location MOD 256| 000008e0 20 20 20 20 73 65 74 20 74 77 6f 20 62 79 74 65 | set two byte| 000008f0 73 20 69 6e 20 7a 65 72 6f 2d 70 61 67 65 20 74 |s in zero-page t| 00000900 6f 20 70 6f 69 6e 74 20 74 6f 0d 53 54 41 26 7a |o point to.STA&z| 00000910 7a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |z | 00000920 20 20 20 20 20 20 20 20 20 20 74 68 65 20 73 70 | the sp| 00000930 72 69 74 65 20 6c 6f 63 61 74 69 6f 6e 2e 0d 4c |rite location..L| 00000940 44 41 23 73 70 72 69 74 65 5f 6c 6f 63 61 74 69 |DA#sprite_locati| 00000950 6f 6e 20 44 49 56 20 32 35 36 0d 53 54 41 26 7a |on DIV 256.STA&z| 00000960 7a 2b 31 0d 4c 44 59 23 30 0d 2e 6c 6f 6f 70 0d |z+1.LDY#0..loop.| 00000970 4c 44 41 28 26 7a 7a 29 2c 59 20 20 20 20 20 6c |LDA(&zz),Y l| 00000980 6f 61 64 20 62 79 74 65 20 6f 66 20 73 70 72 69 |oad byte of spri| 00000990 74 65 0d 53 54 41 26 73 73 73 73 2c 59 20 20 20 |te.STA&ssss,Y | 000009a0 20 20 73 61 76 65 20 74 6f 20 73 63 72 65 65 6e | save to screen| 000009b0 20 6c 6f 63 61 74 69 6f 6e 0d 49 4e 59 0d 43 50 | location.INY.CP| 000009c0 59 23 38 20 20 20 20 20 20 20 20 20 20 38 20 3d |Y#8 8 =| 000009d0 20 65 78 61 6d 70 6c 65 20 68 65 69 67 68 74 20 | example height | 000009e0 6f 66 20 73 70 72 69 74 65 0d 42 43 43 20 6c 6f |of sprite.BCC lo| 000009f0 6f 70 20 20 20 20 20 20 20 6c 6f 6f 70 20 69 66 |op loop if| 00000a00 20 59 20 3c 20 38 0d 2e 2e 2e 0d 0d 2e 73 70 72 | Y < 8.......spr| 00000a10 69 74 65 5f 6c 6f 63 61 74 69 6f 6e 0d 3c 64 61 |ite_location.<da| 00000a20 74 61 3e 0d 0d 49 20 68 6f 70 65 20 74 68 61 74 |ta>..I hope that| 00000a30 20 79 6f 75 20 63 61 6e 20 64 65 63 6f 64 65 20 | you can decode | 00000a40 67 61 6d 65 73 20 61 73 20 77 65 6c 6c 20 61 73 |games as well as| 00000a50 20 74 68 69 73 20 6c 65 74 74 65 72 20 2d 20 69 | this letter - i| 00000a60 66 20 73 6f 2c 20 79 6f 75 0d 73 68 6f 75 6c 64 |f so, you.should| 00000a70 20 65 61 63 68 20 62 65 20 61 62 6c 65 20 74 6f | each be able to| 00000a80 20 77 72 69 74 65 20 65 78 63 65 6c 6c 65 6e 74 | write excellent| 00000a90 20 67 61 6d 65 73 20 66 6f 72 20 75 73 20 61 6c | games for us al| 00000aa0 6c 20 74 6f 20 70 6c 61 79 21 0d 0d 48 61 70 70 |l to play!..Happ| 00000ab0 79 20 68 61 63 6b 69 6e 67 2e 0d 0d 4d 61 72 6b |y hacking...Mark| 00000ac0 20 42 65 6c 6c 69 73 0d 31 31 38 2c 20 54 68 65 | Bellis.118, The| 00000ad0 20 4c 61 77 6e 73 2c 0d 52 6f 6c 6c 65 73 74 6f | Lawns,.Rollesto| 00000ae0 6e 2d 6f 6e 2d 44 6f 76 65 2c 0d 42 75 72 74 6f |n-on-Dove,.Burto| 00000af0 6e 2d 6f 6e 2d 54 72 65 6e 74 2c 0d 53 74 61 66 |n-on-Trent,.Staf| 00000b00 66 73 2c 0d 44 45 31 33 20 39 44 45 0d |fs,.DE13 9DE.| 00000b0d