Skip to content

Commit

Permalink
Merge pull request #1 from Timendus/hires-support
Browse files Browse the repository at this point in the history
Hires support
  • Loading branch information
Timendus authored Oct 31, 2023
2 parents ecea674 + 6c5349b commit 4d88f31
Show file tree
Hide file tree
Showing 11 changed files with 220 additions and 131 deletions.
Binary file added pictures/hires-placeholder-message.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added roms/blobo.ch8
Binary file not shown.
Binary file added roms/blobo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added roms/rockto.ch8
Binary file not shown.
Binary file added roms/rockto.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 15 additions & 5 deletions src/display.8o
Original file line number Diff line number Diff line change
Expand Up @@ -331,14 +331,17 @@
:end

# Copy the given buffer to the display, for full screen mode
# Inputs: i = pointer to buffer
# Destroys: v0, v1, v2, v3, v4, i
# Inputs: i = pointer to buffer, v8 = 128 for hires, 64 for lores
# Destroys: v0 - v7, i
: buffer-to-display
v0 := 0
v1 := 0
v2 := 15
v3 := 30
v4 := 2
v4 := 45
v5 := 60
v6 := 4
v7 := 2

plane 3
clear
Expand All @@ -347,13 +350,20 @@
loop
sprite v0 v1 15 i += v2 # 0 0
sprite v0 v2 15 i += v2 # 0 15
sprite v0 v3 2 i += v4 # 0 30
if v8 == 128 begin
sprite v0 v3 15 i += v2 # 0 30
sprite v0 v4 15 i += v2 # 0 45
sprite v0 v5 4 i += v6 # 0 60
else
sprite v0 v3 2 i += v7 # 0 30
end
v0 += 8
if v0 != 64 then
if v0 != v8 then
again

return


:segment data

: display-buffer
Expand Down
3 changes: 3 additions & 0 deletions src/background.8o → src/images.8o
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@
: background-image
:include "../pictures/background-layer1.png" 8x64 no-labels
:include "../pictures/background-layer2.png" 8x64 no-labels

: hires-placeholder-message
:include "../pictures/hires-placeholder-message.png" 8x32 no-labels
5 changes: 2 additions & 3 deletions src/macros.8o
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@
:calc FOCUSSED { WINDOW_POSITION + 3 }

:calc RAM { FOCUSSED + 1 }
:calc DISPLAY_BUFFER { RAM + 180 }
:calc MACHINE_SIZE { RAM + 4096 }
:calc MACHINE_SIZE { RAM + 4096 + 1024 }

:alias cycle vD
:alias current-machine vE
:const MAX_MACHINES 8
:const MAX_MACHINES 6

:macro point-to PTR {
vF := PTR
Expand Down
43 changes: 37 additions & 6 deletions src/main.8o
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,20 @@
load v0
if v0 == MODE_FULLSCREEN begin
# Just draw the focussed window to the display in lores mode
lores
update-focussed
point-to DISPLAY_BUFFER
point-to DISPLAY_MODE
load v2 - v2
point-to RAM
v0 := 0x10
v1 := 0x00
add-16-bit-to-i
if v2 == DISPLAY_HIRES begin
v8 := 128
hires
else
v8 := 64
lores
end
jump buffer-to-display
end

Expand Down Expand Up @@ -286,9 +297,18 @@
draw-window
point-to WINDOW_POSITION
load v2 - v3
vF := DISPLAY_BUFFER
unpack-pointer
v4 := 8 # TODO: hires
point-to DISPLAY_MODE
load v0
if v0 == DISPLAY_HIRES begin
:alias unpack-hi vA
:alias unpack-lo vB
:unpack long hires-placeholder-message
else
vF := RAM
unpack-pointer
vA += 0x10
end
v4 := 8
v5 := 32
blit-to-display
end
Expand Down Expand Up @@ -490,6 +510,17 @@
update-focussed
set8 RUNNING STATE_STOPPED
update-focussed

# If window "below" this one is lores, and we're in fullscreen mode, jump
# back to windowed mode.
point-to DISPLAY_MODE
load v1 - v1
i := long window-mode
load v0 - v0
if v0 == MODE_FULLSCREEN begin
if v1 != DISPLAY_HIRES then v0 := MODE_WINDOWED
save v0
end
# jump wait-release # fall through

: wait-release
Expand Down Expand Up @@ -616,7 +647,7 @@
:include "gui.8o"
:include "fonts.8o"
:include "roms.8o"
:include "background.8o"
:include "images.8o"

: free-memory
# Starts here
Expand Down
Loading

0 comments on commit 4d88f31

Please sign in to comment.