Help with Horace

General software. From trouble with the Banyan Tree to OCP Art Studio, post any general software chat here. Could include game challenges...
Redgatemodels
Drutt
Posts: 43
Joined: Wed Sep 06, 2023 6:36 pm

Help with Horace

Post by Redgatemodels »

Having had loads of help successfully getting Jetpac onto microdrive (and vdrivezx) and have now turned my attention to my Mum's favourite Horace Goes Skiing.

Trans Express nearly gets there, but there is a last bit of loading that still looks at the tape not the microdrive. If i play the tzx at the right point this final code loads and it all works.

I have merged the second basic loader that does most of the work, photo as below


Image

The final load does not seem to be coming from this code?

What do the pokes and prints do?

Any help would be appreciated. I'd like to get all 3 original Horaces on microdrive if possible.
User avatar
ParadigmShifter
Dynamite Dan
Posts: 1022
Joined: Sat Sep 09, 2023 4:55 am

Re: Help with Horace

Post by ParadigmShifter »

Those POKES make it crash if you break into the program while it is loading.

Maybe they have also obfuscated the code by poking different values into the actual numerical value shown in the listing (numbers in BASIC are stored as ASCII for printing by LIST but then the actual value is stored afterwards in 5 bytes of data). So the numbers displayed in the listing don't necessarily correspond to the actual numbers BASIC sees when running the code.

EDIT: Maybe the final load is being done by the machine code when it has finished loading in which case it's going to be a pain to convert it to load from the microdrive.

EDIT2: I think they have obfuscated the numbers because if you PRINT AT 22,0;;:LOAD"" after the poke it gives an error.

If you just modify that basic and change it to load from the microdrive does it look like it is trying to load from tape once it finishes?

Don't retype the code just save it to microdrive and modify it... then the actual numbers should be saved ok.
Last edited by ParadigmShifter on Wed May 15, 2024 9:19 pm, edited 1 time in total.
Redgatemodels
Drutt
Posts: 43
Joined: Wed Sep 06, 2023 6:36 pm

Re: Help with Horace

Post by Redgatemodels »

Just so you there's no confusion the output after line 50 is just a CAT of the microdrive
Redgatemodels
Drutt
Posts: 43
Joined: Wed Sep 06, 2023 6:36 pm

Re: Help with Horace

Post by Redgatemodels »

ParadigmShifter wrote: Wed May 15, 2024 9:13 pm

If you just modify that basic and change it to load from the microdrive does it look like it is trying to load from tape once it finishes?

Don't retype the code just save it to microdrive and modify it... then the actual numbers should be saved ok.
I’ll give it a try tomorrow 🙂
User avatar
ParadigmShifter
Dynamite Dan
Posts: 1022
Joined: Sat Sep 09, 2023 4:55 am

Re: Help with Horace

Post by ParadigmShifter »

The numbers don't look obfuscated after I tried a MERGE "" with the tap file anyway.

EDIT: But it does then load more code after the PRINT USR 24576, so it calls a tape loading routine from the machine code... probably be difficult to make it not do that I think?

I tested that by putting a BEEP command in before the PRINT USR 24576 which I heard... then it tried to load something else from tape. So the machine code does some loading from tape too.
User avatar
ParadigmShifter
Dynamite Dan
Posts: 1022
Joined: Sat Sep 09, 2023 4:55 am

Re: Help with Horace

Post by ParadigmShifter »

So basically you are going to have to hack the code to do the loading of the next part of the tape from BASIC via microdrive instead, skip the machine code bit that loads something and call the proper entry point (after the machine code loading has finished). If it does any checks that the memory hasn't been faffed around with (e.g. the BASIC loader has been changed etc.) you'll have to remove them too.

So not trivial but I'm sure someone (not me) ;) will have a proper look at it.
User avatar
Lee P
Manic Miner
Posts: 209
Joined: Fri Jan 05, 2018 9:47 am
Location: The Warehouse
Contact:

Re: Help with Horace

Post by Lee P »

An old post from Spider might help here:
viewtopic.php?p=97349
User avatar
flatduckrecords
Manic Miner
Posts: 827
Joined: Thu May 07, 2020 11:47 am
Location: Oban, Scotland
Contact:

Re: Help with Horace

Post by flatduckrecords »

Yeah, the code at 24576 uses the ROM tape loading routines to load the next part of code, called "m". It's saved with a header indicating it should be loaded to 24576 as well, but the program ignores that and loads it to 23760. Unfortunately that's in the middle of the microdrive maps/channels area so it won't work.


[embiggen]

To get around that I changed the BASIC so that it loads the code into higher memory, and wrote a wee routine to relocate it back to 23760 and 24576.

skiing.tap

That seems to work fine (although it won't load on a 16K Spectrum now) but when I transferred it over to microdrive, it still didn't work. It starts drawing the "HORACE GOES SKIING" text and crashes.

Anyway I couldn't get it to work so I just used @TomD's Z80onMDR utility instead!

skiing.mdr
Redgatemodels
Drutt
Posts: 43
Joined: Wed Sep 06, 2023 6:36 pm

Re: Help with Horace

Post by Redgatemodels »

Thanks that mdr worked great, can you tell me what emulator you used to make the snapshot?

Edit: I installed fuse and tried to snapshot horace and the spider, but got an error wgen creating the snapshot. I did it as soon as the tap file was loaded. Do I need to play through the game until it goes back to the start again before snspshotting?
User avatar
goodboy
Microbot
Posts: 151
Joined: Tue Jul 23, 2019 8:22 am
Location: Russia

Re: Help with Horace

Post by goodboy »

the game can be compressed (to work on 16/48 )

Image
User avatar
SkoolKid
Manic Miner
Posts: 416
Joined: Wed Nov 15, 2017 3:07 pm

Re: Help with Horace

Post by SkoolKid »

Redgatemodels wrote: Thu May 16, 2024 3:14 pm Thanks that mdr worked great, can you tell me what emulator you used to make the snapshot?
Forgive the plug, but I'd recommend using SkoolKit's tap2sna.py for purposes like this:

Code: Select all

$ tap2sna.py https://worldofspectrum.net/pub/sinclair/games/h/HoraceGoesSkiing.tzx.zip
Downloading https://worldofspectrum.net/pub/sinclair/games/h/HoraceGoesSkiing.tzx.zip
Extracting Horace Goes Skiing.tzx
Program: SKIING    
Fast loading data block: 23755,39
Program: skiing    
Fast loading data block: 23755,159
Bytes: s         
Fast loading data block: 16384,6912
Bytes: ski       
Fast loading data block: 24576,8050
Bytes: m         
Fast loading data block: 23760,694
Tape finished
Simulation stopped (PC in RAM): PC=24601
Writing Horace Goes Skiing.z80
SkoolKit - disassemble a game today
Pyskool - a remake of Skool Daze and Back to Skool
User avatar
flatduckrecords
Manic Miner
Posts: 827
Joined: Thu May 07, 2020 11:47 am
Location: Oban, Scotland
Contact:

Re: Help with Horace

Post by flatduckrecords »

SkoolKid wrote: Thu May 16, 2024 5:59 pm Forgive the plug, but I'd recommend using SkoolKit's tap2sna.py for purposes like this
I was just about to recommend it! :D

I normally use Fuse, but the notion of a “perfect” snapshot captured by the tool right after loading is very satisfying.
goodboy wrote: Thu May 16, 2024 4:07 pm the game can be compressed (to work on 16/48 )
That’s cool, thanks!
Redgatemodels
Drutt
Posts: 43
Joined: Wed Sep 06, 2023 6:36 pm

Re: Help with Horace

Post by Redgatemodels »

SkoolKid wrote: Thu May 16, 2024 5:59 pm Forgive the plug, but I'd recommend using SkoolKit's tap2sna.py for purposes like this:

Code: Select all

$ tap2sna.py https://worldofspectrum.net/pub/sinclair/games/h/HoraceGoesSkiing.tzx.zip
Downloading https://worldofspectrum.net/pub/sinclair/games/h/HoraceGoesSkiing.tzx.zip
Extracting Horace Goes Skiing.tzx
Program: SKIING    
Fast loading data block: 23755,39
Program: skiing    
Fast loading data block: 23755,159
Bytes: s         
Fast loading data block: 16384,6912
Bytes: ski       
Fast loading data block: 24576,8050
Bytes: m         
Fast loading data block: 23760,694
Tape finished
Simulation stopped (PC in RAM): PC=24601
Writing Horace Goes Skiing.z80
That is impressive. Installed, ran on a Horace and the spiders tap file. Passed the resulting z80 through z80onMDR and wow, fully working mdr, including the loading screen etc.
User avatar
spider
Dynamite Dan
Posts: 1106
Joined: Wed May 01, 2019 10:59 am
Location: Derby, UK
Contact:

Re: Help with Horace

Post by spider »

Lee P wrote: Wed May 15, 2024 10:59 pm An old post from Spider might help here:
viewtopic.php?p=97349
Yes basically (no pun) that's it. Load it at 23760 instead. Suspect because that's so low (not bothered to try) it would otherwise fall over.
Redgatemodels
Drutt
Posts: 43
Joined: Wed Sep 06, 2023 6:36 pm

Re: Help with Horace

Post by Redgatemodels »

So now I have all 3 Horace’s, I remade the HGS so it loads with the splash screen etc. I’ll combine them on one mdr with a little basic menu and consider it done :D

Lunar Jetman has also been processed, never liked it as a kid, actually bought the tape. Will add it to Jetpac and Tranz Am
User avatar
TomD
Manic Miner
Posts: 400
Joined: Tue Nov 13, 2018 9:47 am
Location: Leeds UK
Contact:

Re: Help with Horace

Post by TomD »

Redgatemodels wrote: Thu May 16, 2024 10:08 pm So now I have all 3 Horace’s, I remade the HGS so it loads with the splash screen etc. I’ll combine them on one mdr with a little basic menu and consider it done :D

Lunar Jetman has also been processed, never liked it as a kid, actually bought the tape. Will add it to Jetpac and Tranz Am
Z80onMDR can create the menu for you, mimics the 128k menu. You can also create your own if you prefer :-)

TomD
Retro enthusiast and author of Flynn's Adventure in Bombland, The Order of Mazes & Maze Death Rally-X. Check them out at http://tomdalby.com
Redgatemodels
Drutt
Posts: 43
Joined: Wed Sep 06, 2023 6:36 pm

Re: Help with Horace

Post by Redgatemodels »

Thanks Tom,
I might need to chat sometime as there's a few snapshots that have hung z80onmdr this evening. Wonder if there's any options etc that might help?
User avatar
TomD
Manic Miner
Posts: 400
Joined: Tue Nov 13, 2018 9:47 am
Location: Leeds UK
Contact:

Re: Help with Horace

Post by TomD »

Redgatemodels wrote: Thu May 16, 2024 11:20 pm Thanks Tom,
I might need to chat sometime as there's a few snapshots that have hung z80onmdr this evening. Wonder if there's any options etc that might help?
No worries, would be interested to see which ones. It doesn't work with every single snapshot but the number that don't work should be very low. I've tried hundreds and the only ones that failed for me are some of the compressed games, which are mostly modern game hacks or demos. Everything else seems to be fine.

When creating the snapshot I highly recommend you use TZX instead of TAP. The only reason I say this is, unless it is a very early game, TAPs are often hacks as they cannot store speed-loaders, and this might cause some issues. TZX is much more likely to be an exact copy of the original game tape.

Also a great way to get a good snapshot is to use Skoolkit and the T2S file for the game you want, these tend to use TZX files where possible and have the right memory location for the entry point. If you are just using Skoolkit on the TAP direct it should be fine but it is worth confirming the Z80s work in an emulator first, it might be possible it took the snapshot too early or after the game has been running for a few seconds. The T2S file will have been verified as working which is why they are worth using.

If you can confirm they work in an emulator then the reason some snapshots don't work is often how the stack is used. Loads of details on the options available on my website if you haven't already checked it out (https://tomdalby.com/other/z80onmdr.html). To get around the stack issue you can use the screen as a buffer, this does cause some corruption though which is why the default is use the stack area. The two key options to try are -c and -sos.

Code: Select all

-c tmbp  - use alternate 2 stage launcher code within the screen/prtbuf. (t)op, (m)iddle, (b)ottom of screen or (p)rtbuf
-sos ROW - put the small 4th stage stack launcher on screen rather than under the stack *note 2bytes will still be under the stack. ROW=pixel row on screen, 0 top, 191 bottom
TomD
Retro enthusiast and author of Flynn's Adventure in Bombland, The Order of Mazes & Maze Death Rally-X. Check them out at http://tomdalby.com
Redgatemodels
Drutt
Posts: 43
Joined: Wed Sep 06, 2023 6:36 pm

Re: Help with Horace

Post by Redgatemodels »

Apologies Tom, it's the Skoolkit that hangs, I need to chat to Skoolkid instead ;)
Redgatemodels
Drutt
Posts: 43
Joined: Wed Sep 06, 2023 6:36 pm

Re: Help with Horace

Post by Redgatemodels »

I did make a 3D Starstrike mdr that went through with no errors but hangs on final running though.
User avatar
TomD
Manic Miner
Posts: 400
Joined: Tue Nov 13, 2018 9:47 am
Location: Leeds UK
Contact:

Re: Help with Horace

Post by TomD »

Redgatemodels wrote: Fri May 17, 2024 8:54 am I did make a 3D Starstrike mdr that went through with no errors but hangs on final running though.
Did you use the T2S file? https://github.com/skoolkid/t2sfiles/bl ... strike.t2s

Just tried that myself and it does crash at the start. Easy to sort by using the -c option, I tried the printer buffer option first and it worked.

Code: Select all

z80onmdr 3d-starstrike.z80 -c p
TomD
Retro enthusiast and author of Flynn's Adventure in Bombland, The Order of Mazes & Maze Death Rally-X. Check them out at http://tomdalby.com
Redgatemodels
Drutt
Posts: 43
Joined: Wed Sep 06, 2023 6:36 pm

Re: Help with Horace

Post by Redgatemodels »

TomD wrote: Fri May 17, 2024 3:02 pm Did you use the T2S file? https://github.com/skoolkid/t2sfiles/bl ... strike.t2s

Just tried that myself and it does crash at the start. Easy to sort by using the -c option, I tried the printer buffer option first and it worked.

Code: Select all

z80onmdr 3d-starstrike.z80 -c p
TomD
Can't remember what file I started with, would be a zipped tap or tzx. Thanks for the suggestions on optiond, will give it a go 👍
Redgatemodels
Drutt
Posts: 43
Joined: Wed Sep 06, 2023 6:36 pm

Re: Help with Horace

Post by Redgatemodels »

Quick play after work and I have all 3 Horace’s in 1 image. Renamed the “run” programs as the menu will be “run”, all went well until I renamed the hspiders one to “runspid”. I got an out of memory error. Renamed back to “run” and all was well. “Spi” works too, so I’ll stick with that. Memory must be sooo tight if the basic loader can’t be 7 characters long ……
User avatar
jpnz
Manic Miner
Posts: 335
Joined: Tue Nov 14, 2017 4:07 pm
Location: Hamilt[r]on - City Of The Future - NZ

Re: Help with Horace

Post by jpnz »

flatduckrecords wrote: Thu May 16, 2024 1:57 am Yeah, the code at 24576 uses the ROM tape loading routines to load the next part of code, called "m". It's saved with a header indicating it should be loaded to 24576 as well, but the program ignores that and loads it to 23760. Unfortunately that's in the middle of the microdrive maps/channels area so it won't work.


[embiggen]

To get around that I changed the BASIC so that it loads the code into higher memory, and wrote a wee routine to relocate it back to 23760 and 24576.

skiing.tap

That seems to work fine (although it won't load on a 16K Spectrum now) but when I transferred it over to microdrive, it still didn't work. It starts drawing the "HORACE GOES SKIING" text and crashes.

Anyway I couldn't get it to work so I just used @TomD's Z80onMDR utility instead!

skiing.mdr
Nice job! If the extended system variables were collapsed then the relocation would work just fine

There's a handy bit of code that comes with LERM Code Compressor 1 which will reclaim the system variables:

Code: Select all

;
chans		equ &5c4f
chinfo		equ &5cb6
reclaim1	equ &19e5
;
	ld hl,(chans)
	ld de,chinfo
	push hl
	xor a
	sbc hl,de
	pop hl
	call nz,reclaim1
;
If the reclaim is run before the relocation, then you'll end up with something like this:



Microdrive image is here
User avatar
flatduckrecords
Manic Miner
Posts: 827
Joined: Thu May 07, 2020 11:47 am
Location: Oban, Scotland
Contact:

Re: Help with Horace

Post by flatduckrecords »

jpnz wrote: Sat May 18, 2024 6:06 am Nice job! If the extended system variables were collapsed then the relocation would work just fine

There's a handy bit of code that comes with LERM Code Compressor 1 which will reclaim the system variables
Wonderful, thank you! That's very helpful.

I had fun hacking at this, but it was getting on for 2am and with $dayjob looming in the morning I decided to call it quits!

I stepped through the code as far as some RST10 instructions, so it seemed like it was the ROM print routine that was getting upset, but that's as far as I got.

Cheers!
Post Reply