Skip to content

Commit

Permalink
IIgs Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
StewBC committed Jul 10, 2024
1 parent 3430092 commit 54d5bb8
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ After I finished that task, I wrote the AI all in C as well. The C code is a li

After making the Windows/Linux/macOS version, I decided to see if I could compile the code using llvm-mos. I removed rendering, audio and input and saw that the game ticks over quite a bit faster than 60 FPS. I then stripped a lot of it down to 8-Bit (everything that doesn't have to be in int 16 is now an int 8). I added the VERA rendering and sprites. This game is awesome on the Commander X16. The CX16 audio is currently done as PCM audio (more or less the same audio as the Windows/Linux version). This isn't a great solution as only 1 stream can play at a time, but is better than nothing.

I then went back to the Apple IIgs version and (almost) finished it. I really started over and brought in only the code I knew I wouldn't really change, but a fair bit was rewritten. In the process I also improved the game a little, so the IIgs version is now actually the best version. At some point I'll migrate the updates back if I can remember them all. The audio implementation for Time Pilot was provided by Antoine Vignaue from Brutal Deluxe Software (as was Mr Sprite and Cadius, both of which I also use in the making of this game). A very big thank you to Brutal Deluxe Software for their support and awesome tools to this community.
I then went back to the Apple IIgs version and finished it. I really started over and brought in only the code I knew I wouldn't really change, but a fair bit was rewritten. In the process I also improved the game a little, so the IIgs version is now actually the best version. At some point I'll migrate the updates back if I can remember them all. The audio implementation for Time Pilot was provided by Antoine Vignaue from Brutal Deluxe Software (as was Mr Sprite and Cadius, both of which I also use in the making of this game). A very big thank you to Brutal Deluxe Software for their support and awesome tools to this community.

## Differences between my version and the 1982 arcade version
This game was designed for the Apple IIgs whereas the Arcade version runs on a rotated screen. The arcade version has a resolution of 224H x 256V whereas the Apple IIgs has 320H x 200V. For this reason, I moved all of the stats such as score, extra lives, etc. over to the right hand side. The Windows/Linux/macOS version also uses a horizontal resolution of 200. The Commander X16 version uses a horizontal resolution of 240 - that matches its 40x30 mode.
Expand Down
23 changes: 21 additions & 2 deletions TimePilot-IIgs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ These instructions are for playing the game, but mostly for converting the art a
## Controls
The game uses the keyboard or Joystick to control the player plane. To use the Joystick, simply press `J` on the title screen. If the J does not turn green (selected) then the game is not detecting the Joystick. Controls on the Joystick (in game) are Up, Down, Left, Right and fire, while the second button is Pause. In the UI, the fire button starts a 1 Player game, and the "Pause" button starts a 2 Player game.

The keyboard controls are (and these also work when playing with the Joystick) `1` - 1 Player, `2` - 2 Player, `ESC` - back up (and quit) and `P` - Pause. The in-game keys are (and these *do not* work in joystick mode) `Option` to rotate left, `Open Apple` to rotate right, `Space` to fire (just hold, don't have to tap - I felt too sorry for the poor spacebar).
The keyboard controls are (and these also work when playing with the Joystick) `1` - 1 Player, `2` - 2 Player, `ESC` - back up (and quit) and `P` - Pause. The in-game keys are (and these rotate keys *do not* work in joystick mode) `Option` to rotate left, `Open Apple` to rotate right, `Space` to fire (just hold, don't have to tap - I felt too sorry for the poor spacebar).

## Getting started
The Apple IIgs version is written in 65816 assembly language, targeting the Orca/M assembler and the build process is done using `make`. Several pieces of software were used to structure the build process, listed below. Not all are free. See below.
Expand All @@ -20,7 +20,26 @@ test | use the emulator to run the game
macros | use Orca/M's macgen to build the needed macro files
indent | put all the source through cadius, sed and awk to format the source
clean | clean up built versions of files
zap | clean and remove intermediate and built files and folders
zap | clean and remove intermediate and built files and folders

### Note about png/tpsmall.png
Mr Sprite will, at the time of writing, generate code to draw tpsmall that is not correct. Under "; Line 8" it at some point generates:
```
LDA $CF,S
AND #$F00F
ORA #$0220
STA $CF,S
SHORT M
```
The manual fix I apply is to make the line `ORA #$0220` read:
```
LDA $CF,S
AND #$F00F
ORA #$0F20
STA $CF,S
SHORT M
```
Without this fix, a pixel is drawn in the play area on the left, that does not belong. It is harmless, but not nice. With the fix the pixel is drawn in the sky color so it doesn't show up.

## Software I use and is needed to rebuild the code and art
Orca/M is an assembler that runs natively on the Apple IIgs. It is not freeware but can be bought from [juiced.gs](https://juiced.gs/). It is called the Opus ][ collection, in the store. At the time of writing this is $25 for a download version.
Expand Down
1 change: 1 addition & 0 deletions TimePilot-IIgs/src/data.asm
Original file line number Diff line number Diff line change
Expand Up @@ -2081,6 +2081,7 @@ dt_mult_4 dc i2'0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60'
dt_mult_6 dc i2'0,6,12,18,24,30,36,42,48,54,60,66,72,78,84,90'
dt_mult_8 dc i2'0,8,16,24,32,40,48,56,64,72,80,88,96,104,112,120'
dt_mult_10 dc i2'0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150'
dt_mult_14 dc i2'0,14,28,42,56,70,84,98,112,126,140,154,168,182,196,210'
dt_mult_15 dc i2'0,15,30,45,60,75,90,105,120,135,150,165,180,195,210,225'
dt_mult_16 dc i2'0,16,32,48,64,80,96,112,128,144,160,176,192,208,224,240'
dt_mult_23 dc i2'0,23,46,69,92,115,138,161,184,207,230,253,276,299,322,345'
Expand Down
2 changes: 1 addition & 1 deletion TimePilot-IIgs/src/draw.asm
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ drawBomberPart entry
lda #^BOMBER_000A_DATA
sta zSpriteDataBank
ldy ptImageStartY
lda dt_mult_15,y
lda dt_mult_14,y
adc ptImageStartX
sta ptImageStartX
lda activeFlags,x
Expand Down

0 comments on commit 54d5bb8

Please sign in to comment.